Android Finish activity error -
so have problem getting activity finish , go parent(right term?) activity.
it gets thread activitythread.performresumeactivity(ibinder, boolean) line: 2241 , gives me invocationtargetexception.(throwable) line:50 following error
java.lang.runtimeexception: unable resume activity {com.android.market.companionpushup/com.android.market.companionpushup.workoutactivity}: java.lang.illegalstateexception: database /data/data/com.android.market.companionpushup/databases/exercise data closed
so guess i'm confused, how have error dealing database when trying finish activity , go original activity (but never hits onresume method in original activity).
the code called start new activity
public void takerest(int time, int addtime) { intent = new intent(this, timeractivity.class); i.putextra("time", time); i.putextra("addtime", addtime); startactivity(i); } then custom timer runs until click button skip rest of timer. @ point never goes original activity (i have set breakpoints @ oncreate, onstart, onresume, onactivityresult), none of breakpoints ever reached without error.
button skip = (button)findviewbyid(r.id.skip); skip.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { timer.cancel(); setresult(result_ok); finish(); } }); other code original activity, never reached when step through debugger
@override protected void onresume() { super.onresume(); } @override protected void onactivityresult(int requestcode, int resultcode, intent intent) { super.onactivityresult(requestcode, resultcode, intent); toast.maketext(workoutactivity.this, "yay", toast.length_short).show(); }
the error tells need know:
java.lang.runtimeexception: unable resume activity {com.android.market.companionpushup/com.android.market.companionpushup.workoutactivity}: java.lang.illegalstateexception: database /data/data/com.android.market.companionpushup/databases/exercise data closed what says database connection used in com.android.market.companionpushup.workoutactivity class has been closed, needed (refilling listview, perhaps?). should examine onpause or onstop code in workoutactivity ensure not incorrectly closing database. using cursorloader or startmanagingcursor?
Comments
Post a Comment