I am creating one class with listview which is populated with http json array, i did this before and code is ok. But when i install application i got white screeen (didn't force close) in LogCat i dont have any error message. LayoutInflater can't set activity_main.
this is the activity_main where i declared a listview.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/black_cool" >
<ListView
android:id="@+id/custom_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:dividerHeight="1dp" />
</FrameLayout>
ListView
objects is in the list_row_layout.xml
no need to post it, everything works.
public class MainActivity extends Activity {
public ArrayList<FeedItem> feedList;
public ListView feedListView;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.activity_main, container, false);
String url = "...";
new DownloadFilesTask().execute(url);
return rootView;
}
public void updateList() {
feedListView= (ListView) findViewById(R.id.custom_list);
feedListView.setAdapter(new CustomListAdapter(this, feedList));
}
}
.... json class and other...
What should be a problem? I tried extending a Fragment
but same result. I tried adding a onCreate
and setContentview
but didn't helped me.
Try this for
extend Activity
and Try this for
extend Fragment