android - Close the App launched using intent when back pressed -
from application "myapp", launching separate applications(say application a,b,c , on) using respective packagename in intent following code:
intent launchintent = getactivity().getpackagemanager().getlaunchintentforpackage(packagename); if(null!=launchintent) { startactivity(launchintent); }
now, when press back, want close application launched. don't have control on application launched. right now, when press come "myapp", launched application's audio keeps playing in background. appreciated. thanks.
from understand, audio played in service or activity , not familiar activities , activity lifecycle. if audio played in service, must stop service in onbackpressed method. if audio in activity, should add stop audio playback in overriden onpause method of playing activity. if launch third party app (and can't access code) can't make stop app.
Comments
Post a Comment