Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing a listview inside a sliding drawer with a listview already present
    text
    copied!<p>I have an app whose main class extends ListActivity:</p> <pre><code>public class GUIPrototype extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Cursor c = managedQuery(People.CONTENT_URI, null, null, null, null); String[] from = new String[] {People.NAME}; int[] to = new int[] { R.id.row_entry }; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.drawer,c,from,to); setListAdapter(adapter); getListView().setTextFilterEnabled(true); } } </code></pre> <p>I have a sliding drawer included in my XML, and I'm trying to get a separate listview to appear in the sliding drawer. I'm trying to populate the second listview using an inflater:</p> <pre><code>View inflatedView = View.inflate(this, R.layout.main, null); ListView namesLV = (ListView) inflatedView.findViewById(R.id.content); String[] names2 = new String[] { "CS 345", "New Tag", "Untagged" }; ArrayAdapter&lt;String&gt; bb = new ArrayAdapter&lt;String&gt;(this, R.layout.main, R.id.row_entry, names2); namesLV.setAdapter(bb); </code></pre> <p>This compiles, and runs, but the slidingdrawer is completely blank. My XML follows:</p> <p></p> <pre><code>&lt;SlidingDrawer android:id="@+id/drawer" android:handle="@+id/handle" android:content="@+id/content" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="bottom"&gt; &lt;ImageView android:id="@id/handle" android:layout_width="48px" android:layout_height="48px" android:background="@drawable/icon"/&gt; &lt;ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@id/content"/&gt; &lt;/SlidingDrawer&gt; </code></pre> <p>I feel like I'm missing a vital step. I haven't found any resources on my problem by Googling, so any help would be greatly appreciated.</p> <p>Edit: This was for a problem a long time ago, and the solution I found was to just redesign my layout. I am unable to accept an answer as I don't have the means to test them.</p>
 

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