Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This ids:</p> <pre><code>android:id="@+id/android:list1" android:id="@android:id/list1" </code></pre> <p>don't exist in the SDK. The id <code>android:id="@+id/list1"</code> is valid and if you use <code>findViewById(R.id.list1)</code> in the <code>Activity</code>(which has as its content the layout with the two <code>ListViews</code>) you'll find the <code>ListView</code>.</p> <p>Also, as your code suggests it appears you're trying to manipulate the two <code>ListViews</code> as one which would be plain wrong. In the <code>onPostExecute()</code> method you'll use the <code>setListAdapter()</code> method to set the adapter for the <code>ListView</code> with the id <code>android.R.id.list</code> and for the other <code>ListView</code> you'll do:</p> <pre><code>ListView second = (ListView) findViewById(R.id.list1); // set the adapter for this ListView </code></pre> <p>Regarding this code:</p> <pre><code> Uri feedUri = Uri.parse(myRssFeed.getItem(position).getLink()); Uri feedUri1 = Uri.parse(myRssFeed1.getItem(position).getLink()); Intent myIntent = new Intent(Intent.ACTION_VIEW, feedUri); Intent myIntent1 = new Intent(Intent.ACTION_VIEW, feedUri1); startActivity(myIntent); startActivity(myIntent1); </code></pre> <p>what are you trying to do starting two(?!?!) activities(to do what?!)?</p> <p>Edit:</p> <pre><code>try { URL rssUrl = new URL("http:/news.rss"); SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance(); SAXParser mySAXParser = mySAXParserFactory.newSAXParser(); XMLReader myXMLReader = mySAXParser.getXMLReader(); RSSHandler myRSSHandler = new RSSHandler(); myXMLReader.setContentHandler(myRSSHandler); InputSource myInputSource = new InputSource(rssUrl.openStream()); myXMLReader.parse(myInputSource); myRssFeed = myRSSHandler.getFeed(); RSSHandler myRSSHandler1 = new RSSHandler(); myXMLReader.setContentHandler(myRSSHandler1); URL rssUrl1 = new URL("http://events.rss"); InputSource myInputSource1 = new InputSource(rssUrl1.openStream()); myXMLReader.parse(myInputSource1); myRssFeed1 = myRSSHandler1.getFeed(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } @Override protected void onPostExecute(Void result) { if (myRssFeed!=null &amp;&amp; myRssFeed1!=null) { ArrayAdapter&lt;RSSItem&gt; adapter = new ArrayAdapter&lt;RSSItem&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, myRssFeed.getList()); setListAdapter(adapter); ArrayAdapter&lt;RSSItem&gt; adapter1 = new ArrayAdapter&lt;RSSItem&gt;(getApplicationContext(), android.R.layout.simple_list_item_1,myRssFeed1.getList()); ListView lv = (ListView) findViewById(R.id.list1); lv.setAdapter(adapter1); } else { setListAdapter(new ArrayAdapter&lt;RSSItem&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, new ArrayList&lt;RSSItem&gt;());); ArrayAdapter&lt;RSSItem&gt; adapterEmpty1 = new ArrayAdapter&lt;RSSItem&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, new ArrayList&lt;RSSItem&gt;()); ListView lv = (ListView) findViewById(R.id.list1); lv.setAdapter(adapterEmpty1); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload