android - Multiple activity instances problem -
in application have activity class has listview cursor adapter. can go activity b, pressing button. b can go pressing button (not pressing button). means new instance of activity created.
from point, if press key, current activity destroyed , b popped. , if press again initial activity popped. hope clear.
my problem when second activity destroyed, database connection reseted, in static manner. in end, when initial activity displayed, listview empty.
my question is: should try have single instance activities, or shoud change database connection (to link activity instance)?
thanks lot gratzi
first of in class carrying listview . on clicking listview call startactivity method class b activity without calling finish(). hope doing. in second activity button (not button) using calling activity . in clicklistener calling activity dont call startactivity(intentfora) instead call finish(); ending activity b. resume activity paused..
i hope
Comments
Post a Comment