Android - onCreate() called despite using SingleTop launch mode -
i have 2 activities in application.
the second activity in application prompts notification icon presented in notification bar.
the intent first activity second uses flag_activity_singletop
, flag_activity_clear_top
flags in intent. same goes intent used in pendingintent
notification.
my aim second activity single activity , created once, when user leaves via home button , goes activity via notification, instance running comes , oncreate
not called.
this approach works on devices, testing on 1 device in particular (a sony xperia device - 4.0.4) has shown doesn't work in cases.
on sony xperia oncreate
of second activity called when entered user, notification.
i have tried using singletop in manifest
without success. bug in device or doing wrong? perhaps missing flag need or along lines?
if wants more specific code or information please let me know , post it.
first of all, please note android kill activity when app backgrounded. there no guarantee activity stay alive while app backgrounded. in case, in projects end using singleinstance
launch mode activities 1 instance should running @ same time.
just try update androidmanifest
singleinstance
launch mode activity:
<activity android:name="com.your.package.youractivity" android:launchmode="singleinstance"/>
Comments
Post a Comment