I have an application whose main class extends ListActivity:
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);
}
}
I have a sliding box included in my XML, and I'm trying to get a separate list to appear in a sliding drawer. I am trying to populate the second list with an additional device:
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<String> bb = new ArrayAdapter<String>(this, R.layout.main, R.id.row_entry, names2);
namesLV.setAdapter(bb);
This compiles and starts, but the sliding frame is completely empty. My XML follows:
<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">
<ImageView
android:id="@id/handle"
android:layout_width="48px"
android:layout_height="48px" android:background="@drawable/icon"/>
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@id/content"/>
</SlidingDrawer>
I feel that I am missing a life step. I did not find any resources for my problem in Googling, so any help would be greatly appreciated.
Edit: this has been a problem a long time ago, and the solution I found is to simply reverse engineer my layout. I can not accept the answer, because I do not have the means to verify them.