0
public class ContentView1 extends ActionBarActivity {

private ListView Content1;
private List<HashMap<String,Object>> books_List;
private  dbHandler db;

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_content_view1);

    getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    Content1 = (ListView)findViewById(R.id.BtnListView);

    db=new dbHandler(getBaseContext());
    db.close();
    db.open();

When wright open database method for new activity i see error in open how can fix it?

Please guide me

swiftBoy
  • 35,607
  • 26
  • 136
  • 135

1 Answers1

0

you have to 1st open database and then you can close that.

db.open();
//your databa

db.close();