开发者

Android activities question

I have three activities, A, B and C.

User can start activity B from A, and then C from B.

I would like to 开发者_StackOverflow中文版have following. In C the user fill some field and click "OK"-Button. After that both activities B and C should be finished.

I don't like my idea, to finish A after starting B, then finish B after starting C, and then start A from C.

What is the best way to do that?!

Is it possible to finish parent activity from the child? If, yes, then that would be my solution. But i haven't find any information about that.

Thank you,

Mur


in Activity B, call Activity C with startActivityForResult. In the ActivityB.onActivityResult() method, call finish() when Activity C returned with a good result. This gets you back to Activity A.


try This In Activity C Class

 Intent mIntent=new Intent(getApplicationContext(),A.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 startActivityForResult(mIntent);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜