Monday 15 September 2014

android - Get ListView in Fragment class , get NullPointerException -


मेरा टुकड़ा लेआउट:

  & lt; relativeLayoutLayout xmlns: android = "http: // Schemas.android.com/apk/res/android "xmlns: tools =" http://schemas.android.com/tools "एंड्रॉइड: layout_width =" match_parent "एंड्रॉइड: layout_height =" match_parent "& gt; & Lt; ListView एंड्रॉइड: id = "@ + id / my_list" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = "match_parent" / & gt; & Lt; / RelativeLayoutLayout & gt;  

मेरे टुकड़ा वर्ग में:

  सूची दृश्य myList; सार्वजनिक देखें क्रिएटिव्यू (लेआउटइनफ्लेटर इन्फ्लाटर, व्यू ग्रुप कंटेनर, बंडल सहेजे गए इन्स्टेंसस्टेट) {// नल पॉइंटर एक्सेप्शन मायलिस्ट = (लिस्ट्यूव्यू) getView ()। FindViewById (R.id.my_list); ...}  

मुझे सूचीपीप प्राप्त करने का प्रयास करते समय NullPointerException क्यों मिलता है?

No comments:

Post a Comment