diesen Quellcode heruntergeladen: https://github.com/shikha14/ParsingRssFeedsJava/Android feedparser - Hinzufügen eines weiteren Menüpunkt
Ich will mehr Menüpunkte hinzufügen, aber es arbeitet nicht ...
Der ursprüngliche Code in
AppUtils.java
public class AppUtils {
public static final String RSS_CNN_NEWS = "http://rss.cnn.com/rss/cnn_latest.rss";
public static final String RSS_GOOGLE_NEW = "https://news.google.com/?output=rss";
public static final String TAG = "DIGIPLUSE";
und Api.java:
public void getNews(int position, FetchListener listener) {
String url = null;
if (position == 0) {
url = AppUtils.RSS_CNN_NEWS;
} else {
url = AppUtils.RSS_GOOGLE_NEW;
}
new AsyncHTTPPost().execute(url, listener);
}
Ich versuche dies:
public class AppUtils {
public static final String RSS_1 = "http://example.org/feed&type=rss";
public static final String RSS_2 = "http://example.org/feed&type=rss";
public static final String RSS_3 = "http://example.org/feed&type=rss";
public static final String RSS_4 = "http://example.org/feed&type=rss";
und diese:
public void getNews(int position, FetchListener listener) {
String url = null;
if (position == 0) {
url = AppUtils.RSS_1;
} else {
url = AppUtils.RSS_2;
url = AppUtils.RSS_3;
url = AppUtils.RSS_4;
}
Wenn ich die App starten, die 4 Elemente angezeigt, aber die URL Arbeit nur für die ersten und zweiten Menüpunkte .. hat jemand eine idee?
Danke für Antworten ...
Danke, dass die Arbeit für mich ... – Humfeld