How do I keep/bring app to the top?

I would like to keep or bring the app to the top based on certain criteria.

Also, is it possible to tell what app is currently on the top?


  • CharwakaCharwaka INMember ✭✭✭✭✭

    Hi @ncc26632

    when you want to bring Top ? on what conditions ? can you please elaborate.

  • ncc26632ncc26632 Member

    I'd like to bring the app to the top if the user goes back to the home screen.

    My apologies for being so vague in my OP.. I will go into much more detail now..

    I am new to mobile development.

    For my first project I would like to create an app similar to Kid's Place. If you aren't familiar with it, it is an app that parents can put on their kids' devices that always runs in the foreground unless the user clicks an app that is on the app's home screen. If the user attempts to exit the app or go to the os homescreen, it brings them back to the app.

    I want to build an app similar to this for 2 reasons, 1) I'd like to use it 2) I believe creating this app will help me dive deep into the os fundamentals.

    If you know of an open source project similar to this, please reference it and I will pick through the code.


  • CharwakaCharwaka INMember ✭✭✭✭✭

    Hi @ncc26632

    please check this "This will make you app foreground always even though users switches to home screen,and make app run 24/7 unless user kills or system kills it , you need to port this code to Xamarin.Android , its a very little difference code wise

  • gishagisha Member

    Someone please help me on this. I am working on Xamarin UI test and trying to automate a scenario wherein the user clicks on the call button from the app and the device phone app is opened. To go back to the application, I have to manually click the back button twice. I tried automating this by calling the "onBackPressed" backdoor from the main activity. But it is not working. No I am thinking if I can rather bring the app to foreground in its current state. If someone can help, it will be greatly appreciated.

Sign In or Register to comment.