I create CustomListAdapter in Android Appiclation. But i get this error NullPointerException
when implement it.
Here is my CustomListAdapter.java code :
add AppController(Activity request) to your manifest:
<application
android:name=".AppController" //this one
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
I noticed that you use private List<com.fanjavaid.searchhttprequest.model.Menu> menuList = new ArrayList<com.fanjavaid.searchhttprequest.model.Menu>();
, but you never actually add anything to that list before you call:
listView = (ListView) findViewById(R.id.list);
adapter = new CustomListAdapter(this, menuList);
listView.setAdapter(adapter);
You probably want to put something in that menuList
I think you didn't add AppController to your manifest:
<application
android:name=".AppController" //this one
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
That's why onCreate never called and mInstance is null.