rawQueryメソッドを使用してデータのリストをCursorとして取得し、startManagingCursor()およびstopManagingCursor()メソッドを使用しています。Activity1とActivity2には問題はありませんが、Activity3からActivity2に移動しようとすると、04-09 17:37:59.629: E/AndroidRuntime(6509): java.lang.RuntimeException: Unable to resume activity {com.nepways.nlocate/com.nepways.nlocate.BusinessOrganizationActivity}: java.lang.IllegalStateException: database /data/data/com.nepways.nlocate/databases/nLocateDatabaseNew.db already closed
誰か助けがありますか?
更新コード
public class BusinessActivity extends Activity implements OnItemClickListener {
private ArrayList<Business> businessList = new ArrayList<Business>();
private BusinessListAdapter businessListAdapter;
private ListView lvBusiness;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.business_list);
businessList = getIntent().getParcelableArrayListExtra("businessList");
businessListAdapter = new BusinessListAdapter(this, businessList);
lvBusiness = (ListView) findViewById(R.id.lvBusiness);
lvBusiness.setAdapter(businessListAdapter);
// lvBusiness.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add("Search").setIcon(R.drawable.ab_search).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
// return super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getTitle().toString().equalsIgnoreCase("Search")) {
startActivity(new Intent(this, SearchActivity.class));
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onPause() {
super.onPause();
}
}