Closed Ishu25 closed 7 years ago
Thanku so much @chehanr , ur code works . But This opens the new activity and I want to resume the activity where I Leave or close the app . I mean If app is playing then there would be a stop button but when I open that activity from notification then it will open the new activity where play button is showed rather than resuming the activity . So plz provide the code so that main activity resumes when click on notification rather than open new activity. Thanks,
You should try saving the play/ stop state of the button on Shared Preferences. so when you reopen the app the button remain on the play state rather than stop.
@chehanr can u provide any code for this ?
A better method is,
if (mRadioManager.isPlaying()) {
mControlPlay_Pause.setImageResource(R.drawable.ic_pause);
} else {
mControlPlay_Pause.setImageResource(R.drawable.ic_play_arrow);
}
@Ishu25
add <activity android:name=".RadioMainActivity" android:theme="@style/AppThemeBar" android:launchMode="singleTop" android:configChanges="orientation|screenSize"/>
I want that whenever I click on the notification then it will open the app directly . But as know I it would only open the the home screen of the mobile whenever I click on notification Rather then opening the app ?