android - Will opened database connections still be opened after a "close-all"? -
i found other posts way close activities :
intent intent = new intent(logout.this, mainactivity.class); intent.setflags(intent.flag_activity_clear_top); intent.putextra("exit me", true); startactivity(intent); finish(); if( getintent().getbooleanextra("exit me", false)){ finish(); return; // add prevent doing unnecessary stuffs } my question : if there opened database connection in activities , these opened connections closed or not when above code execute ?
just because you've added code activity:
if( getintent().getbooleanextra("exit me", false)){ finish(); return; // add prevent doing unnecessary stuffs } no, won't closed automatically. should close connections @ ondestroy method, example, make happen.
Comments
Post a Comment