Simple Listview in fragment using SimpleAdapter
问题 Here is my code for fragment extending ListFragment and below are the errors it is showing.Almost Same code is working fine for activity except that in activity i am getting listview through ListView lv = getListView(); and in fragment through lv= (ListView)rootView.findViewById(R.id.list); It shows nullpointer exception on line java:109 lv.setOnItemClickListener(new AdapterView.OnItemClickListener() If i remove setOnItemClickListener it shows null pointer exception on lv.setAdapter(adapter);