मैं एक ऐप्स जिसका मुख्य वर्ग फैली 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);
}
}
मैं एक रपट दराज मेरी एक्सएमएल में शामिल किया है, और मैं एक पाने के लिए कोशिश कर रहा हूँ स्लाइडिंग ड्रॉवर में दिखाई देने के लिए अलग सूचीदृश्य। मैं एक inflater का उपयोग कर दूसरी सूचीदृश्य पॉप्युलेट करने के लिए कोशिश कर रहा हूँ:
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);
यह संकलित, और रन है, लेकिन पूरी तरह से slidingdrawer खाली है। मेरे एक्सएमएल इस प्रकार है:
<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>
मुझे लगता है कि मैं एक महत्वपूर्ण कदम याद कर रहा हूँ। मुझे गुगलिंग द्वारा मेरी समस्या पर कोई संसाधन नहीं मिला है, इसलिए किसी भी मदद की सराहना की जाएगी।
संपादित करें: यह बहुत समय पहले एक समस्या के लिए था, और मुझे जो समाधान मिला वह सिर्फ मेरे लेआउट को फिर से डिजाइन करना था। मैं एक जवाब स्वीकार करने में असमर्थ हूं क्योंकि मेरे पास परीक्षण करने का साधन नहीं है।
मुझे इस सवाल का जवाब स्वीकार करने में सक्षम नहीं होने के कारण बुरा लगता है। हमने इस मुद्दे से पूरी तरह से बचने के लिए हमारे यूआई के लिए एक और मार्ग तय करने का फैसला किया है, और इसलिए मेरे पास उत्तर स्वीकार करने का कोई वास्तविक आधार नहीं है :( – Parker