android - How to return to my original activity when new activity is closed? -
i have app used remote control industrial process, 3 activities a, b, , graphicsactivity. main activity , b screen additional features user can access.
there's separate stand-alone class, pccomms, runs in own thread , handles communication pc controls industrial process. every pc sends android image display , pccomms fire off graphicsactivity display user. user taps button close it.
this problem: when user closes graphicsactivity returns a, if user in b @ time.
pccomms not activity, generic class needs activity context have context variable gets updated whichever activity had screen @ time graphics displayed:
intent intent = new intent(curcontext, graphicsactivity.class); intent.putextra("caption", sgcaption); curcontext.startactivity(intent);
... i've confirmed in debugger curcontext b's context. when graphicsactivity launches, b's onpause() gets called none of b's life-cycle events called when graphicsactivty finish() es.
relevant manifest entries . . .
<activity android:name="a" android:launchmode="singletask" android:screenorientation="portrait"> </activity> <activity android:name="b" android:screenorientation="portrait" android:launchmode="singleinstance"> </activity> <activity android:name="graphicsactivity" android:screenorientation="portrait" android:launchmode="standard"> </activity>
so if i'm in b when graphicsactivity opened, how return b when graphicsactivity closed?
thanks in advance!
since b singleinstance, graphicsactivity put in task stack when finish() a. should make b standard , whenever call b can use flag_activity_clear_top. make graphicsactivity singleinstance.
Comments
Post a Comment