1

I am creating a control app for the sound systems in place in certain areas like bars/clubs/events ect...

I need my app so that lets say a manager closes the android tablet but doesn't fully close the app i am building, then it will still re-start the app anyway as if she had? so when the next person who picks it up which might not be a manager gets taken back to the first activity (log in page) - - - (for log in / security purposes)

I have seen a few different ways on here but found they either dont work or caused memory leaks...

Any advice on doing this would be great, thank you!

A.Turner
  • 196
  • 1
  • 13

2 Answers2

1

call finish in on stop. But i think better to call fragment with login screen in each on resume. Than if user is same you just hide fragment and if user is different you create new activity and close current

Yarh
  • 4,459
  • 5
  • 45
  • 95
0

The best way to do this is to detct when the app goes in background so when the current activity is restart you can call your disconnect function and go to the connection Activity.

To detect when the app go in background, I used the solution explained here

I personaly took the answer of "d60402" So you can choose the timer after which the app is considered in background.

Aznhar
  • 610
  • 1
  • 10
  • 30