startActivity(intent) and resume to main activity?

℡╲_俬逩灬. 提交于 2019-12-24 10:28:31

问题


I've got an app that creates an intent for the last.fm android app in which it will start the "recommended" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically.


回答1:


If you use startActivity(intent), you cannot. Alternatively, you can use startActivityForResult(Intent, int) and then stop the child activity with finishActivity(int requestCode).




回答2:


Call Activity.finish() whenever you want close the present Activity and get back to an earlier one.



来源:https://stackoverflow.com/questions/3163928/startactivityintent-and-resume-to-main-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!