Android Question [SOLVED]On API26 Notification recreate activity instead of resume

KZero

Active Member
Licensed User
Longtime User
Hello,

i tried both built in notification and notification builder
both on API 26 recreating the activity when i click on the notification even if the activity is active

any idea how to just resume the activity as usual ?
 

KZero

Active Member
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The Notification object is rewritten in B4A 8 due to Api changes.
Don´t know how to do it in older Versions.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
b4a 8 require some changes to my projects and no time to do that now

Yes, but not a lot. Two-three hours, mainly manifest. + Services are "Oreo-ready".
Most of us made changes - nothing terrible.
Just now it's necessary to think about API26+ - all new smartphones during last year have Android 8.0/8.1.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
i tried both built in notification and notification builder
both on API 26 recreating the activity when i click on the notification even if the activity is active
You should expect your activity to be destroyed and recreated on all kinds of cases. This is how Android works.
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
And to use Api 26 successfully you need B4A 8+ -> Time to update B4A

You should expect your activity to be destroyed and recreated on all kinds of cases. This is how Android works.
I know about Activity life cycle , in my case the activity not destroyed to be created again
updated to B4A 8.5 it is ok if the notification calling the last active activity , if not the activity recreated


changed manifest for the activity android:launchMode to singleTask instead of singleTop fixed the problem

Thanks
 
Upvote 0
Top