0

I have an app which enables users to set tasks with specific time deadlines. Once a deadline is passed, I want the app to show a view on top of everything (requesting the user to update the task).

My issues are: - how to show my app's view on top of every other activity that is currently active - how to keep the activity on top until the user updates the task?

Is using something like SYSTEM_ALERT_WINDOW look sensible?

STiGMa
  • 906
  • 3
  • 11
  • 24
  • These links might help you. https://stackoverflow.com/questions/40355344/how-to-programmatically-grant-the-draw-over-other-apps-permission-in-android https://stackoverflow.com/questions/36016369/system-alert-window-how-to-get-this-permission-automatically-on-android-6-0-an – ashazar Mar 29 '19 at 11:03
  • How are you tracking deadlines in background ? AlarmManager ? – ADM Mar 29 '19 at 11:09
  • 1
    Use a heads-up notification instead – Tim Mar 29 '19 at 11:20
  • @ADM, It's a service running in the background. Any code snippet for inspiration? – STiGMa Mar 29 '19 at 14:19

1 Answers1

1

You can try create a transparent Activity, open it and show alert dialog.

Den
  • 1,284
  • 2
  • 14
  • 33
  • What if the app is in background? – Onik Mar 29 '19 at 11:06
  • The question is what's gonna call this Activity, yeah. Is it some kind of service of smth? In my case it's Push-notification and if user taps it the transparent activity with alertdialog appears. – Den Mar 29 '19 at 11:08
  • In other words you have to move the app in foreground in order to do this. – Onik Mar 29 '19 at 11:09