im getting a weird problem when refreshing my listview it works fine until the device is rotated and then when refreshing it again it goes completely blank. can only be fixed by rotating the device again (as it is also refreshed in onCreate()) but then whenever its refreshed again it goes blank. problem persists until app is restarted.
thanks for any help, ng93
EDIT: some code:
private ListView contactlist = null;
private static MatrixCursor matrixcursor = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
contactlist = (ListView) findViewById(R.id.contactlist);
if (savedInstanceState == null) {
matrixcursor = new MatrixCursor(new String[] {"_id","name","one","two","three","four"});
} else {
contactlist.setAdapter(new listCursorAdapter(this,matrixcursor));
}
}
this works fine but whenever
contactlist.setAdapter(new listCursorAdapter(this,matrixcursor));
is called after onCreate() and after the device has been rotated the listview goes blank