Forum Xamarin.Android

ExcludeFromRecents=true

meirrotfleischmeirrotfleisch USMember ✭✭✭

Hi

I was under the impression that adding the ExcludeFromRecents=true as part of th Actvity[] would remove the Intent from the "app's back browse button"

Can the be put in all my activities?
I am calling an activity using alarmmanager and when user leaves the alarm screen it again send Intent to the mainactivity

I am still seeing multiple intents (screens) when i hit the back button on the device

Regards

Meir

Best Answer

  • meirrotfleischmeirrotfleisch USMember ✭✭✭
    Accepted Answer

    Hi To all who viewed and considered helping me.. I found the solution

    For anyone else wondering..

    1) I am using a systemtimer to refresh every minute or two..
    2) i am using the MainThread.BeginInvokeOnMainThread(() to be able to connect to the DB refresh the data and update the ViewList
    3) I am using OnResume to call the Update thread since when coming back its obvious that the records in the DB to be listed have changed.. (added or removed)

    Regards

    M.R.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Try to add a clear top tag to the intent when pushing:

    intent.AddFlags(ActivityFlags.ClearTop);
    

    If you keep pushing the same activity in your alarmmanager like:

    A=>B=>B=>B=>...
    

    There will be only one B in the stack after using ClearTop. And then the A activity will be displayed when the user clicks
    the back button to return.

  • meirrotfleischmeirrotfleisch USMember ✭✭✭

    @LandLu Thanks...

    When B closes i need to rerun the code to refresh the from the DB

    What is the correct overload for OnAppearing? or would you suggest I use a System.Timer?

    Regards

    M.R.

  • meirrotfleischmeirrotfleisch USMember ✭✭✭
    Accepted Answer

    Hi To all who viewed and considered helping me.. I found the solution

    For anyone else wondering..

    1) I am using a systemtimer to refresh every minute or two..
    2) i am using the MainThread.BeginInvokeOnMainThread(() to be able to connect to the DB refresh the data and update the ViewList
    3) I am using OnResume to call the Update thread since when coming back its obvious that the records in the DB to be listed have changed.. (added or removed)

    Regards

    M.R.

Sign In or Register to comment.