RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' -


मुझे एक रन टाइम अपवाद मिल रहा है

java.lang.RuntimeException: आपकी सामग्री चाहिए एक ListView जिसका आईडी विशेषता 'android.R.id.list' है

मुझे नहीं पता कि क्या गलत है।

  @Override सार्वजनिक शून्य ऑन क्रेट (बंडल सहेजे गए इन्स्टैंसस्टेट) {सुपर। कॉन्टेट (सहेजे गए इन्स्टेंसस्टेट); setContentView (R.layout.newslist); mDbHelper.open (); fillData (); } प्राइवेट व्हायर फिलडाटा () {बंडल एक्स्ट्रास = मिलनेंटेंट ()। GetExtras (); लंबे कैटआईडी = एक्स्ट्रास.गेट लाँग ("कैट_आईडी"); कर्सर c = mDbHelper.fetchNews (catID); startManagingCursor (ग); स्ट्रिंग [] = नए स्ट्रिंग से [] {DBHelper.KEY_TITLE}; Int [] से = नए int [] {R.id.newslist_text}; सरल कर्सर एडाप्टर नोट्स = नया सरलकर्त्ता एडाप्टर (यह, आर। लेटाइट.टेक्स्ट_एनसलिस्ट, सी, से, से); setListAdapter (नोट्स); }  

newslist.xml

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt ; & Lt; LinearLayout xmlns: एंड्रॉइड = "http://schemas.android.com/apk/res/android" एंड्रॉइड: layout_width = "wrap_content" एंड्रॉइड: layout_height = "wrap_content" & gt; & Lt; ListView एंड्रॉइड: id = "@ + id / catnewslist" एंड्रॉइड: layout_width = "wrap_content" एंड्रॉइड: layout_height = "wrap_content" & gt; & Lt; / ListView & gt; & Lt; / LinearLayout & gt;  

text_newslist.xml

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; LinearLayout xmlns: एंड्रॉइड = "http://schemas.android.com/apk/res/android" एंड्रॉइड: layout_width = "wrap_content" एंड्रॉइड: layout_height = "wrap_content" & gt; & Lt; TextView android: text = "@ + id / newslist_text" एंड्रॉइड: id = "@ + id / newslist_text" एंड्रॉइड: layout_width = "wrap_content" एंड्रॉइड: layout_height = "wrap_content" & gt; & Lt; / TextView & gt; & Lt; / LinearLayout & gt;  

<पूर्व> & lt; ListView android: id = "@ android: id / list "Android: layout_width =" fill_parent "एंड्रॉइड: layout_height =" fill_parent "/ & gt;

यदि आप अभी भी ListActivity का उपयोग करना चाहते हैं तो यह त्रुटि को हल करेगा।


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -