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.
精彩评论