I am trying to display ListView.
I have created one activity , in onCreate() method I am launching one AsyncTask and in onPostExecute() method I am trying display ListView in that .
but listView object receiving null..
Below is the code snippet.
protected void onPostExecute(KpiResponseObject kpiReportResponse) {
ListView listView;
listView = (ListView) findViewById(R.id.list_view);
}
Here I’am receiving null in listView object.
I am suspecting this is the context problem , but not able figure out what exactly it is.
Are you sure you have
setContentViewin youronCreateand then have aListViewlist_viewdefined in XML?