开发者

How to Resume Previous running application from An Application in Android?

开发者 https://www.devze.com 2023-03-13 22:17 出处:网络
Give me a little guidance: as My Application is running with Broadcast Receiver and when ever my application in Background and any incoming event comes it triggers the my Application.

Give me a little guidance: as My Application is running with Broadcast Receiver and when ever my application in Background and any incoming event comes it triggers the my Application.

Now we want as We are liste开发者_Python百科ning or playing some video file or browsing on Android Phone and with incoming event occur and my application launch(already running in Background), If i will ignore the event , we want to go back previous running task (Like browsing, playing video file application), How we can achieve?


Now I am using The store the running application package and Activity info before triggering the Event , and after finishing using this info we resuming the Activity and It working fine but Only with Gallery Application Playing of Vedio file is not fine , It Crashes the Application and relaunch the Gallery App.

Please give me some Valuable points to make it up?


On calling finish, Previous application resume(Playing of Media file) but when next time on getting broadcast intent and try to launch the Activity , The Activity is not launching and application itself crashing.



After a long back I got solution of my problem and we need only use to this api

moveTaskToBack(true);

and automatically resumes the previous running task(like browser, media application or any thing)


Have you tried to start you activity by

startActivityForResult(Intent intent)

When you call finish() in the Activity you should return the the previous one, I am not sure if this will function over between Activity running in different applications. Give it a try :D

0

精彩评论

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

关注公众号