Here is the code where I add the list to my fragmet list:
public void onAttach(Activity activity) { super.onAttach(activity); System.err.println("Fragment Attach"); String[] MyList = {"Item 1","Item 2","Item 3","Item 4","Item 5"}; System.err.println("File Row ID" + Integer.toString(R.layout.file_row)); ArrayAdapter<String> aa = new ArrayAdapter<String>(getActivity(), R.layout.file_row, MyList);
However, the string this.getListView (). addHeaderView (tv); gives me an error
06-11 15: 24: 46.110: ERROR / AndroidRuntime (8532): Called: java.lang.IllegalStateException: Content view not created yet
And the program will fail.
Can someone tell me what I am doing wrong?
source share