开发者

How to stop an Activity from parent Activity?

_alerts = new Intent(homeActivity,Alertss.class);
homeActivity.startActivity(_alerts);
...
...
...
homeActivity.stopService(_alerts);

I need to stop the Activity i created from the object where i created it. I tried it 开发者_StackOverflowin the way above but it did not work. Can any one suggest me a way to do this.


You can use Activity.startActivityForResult() and then Activity.finishActivity() passing in the same result code you used for starting it.

However, this does sound like something that would be better done just as a Dialog.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜