Android Question Lock / Unlock Screen after Activity is started

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

a togglebutton, placed at the bottom of the screen, is used to start an activity. The activity is stopped by pressing the togglebutton again.

Issue: If, after Starting the activity, the device is put in the pocket it can happen that the togglebutton is pressed again without purpose and the activity is stopped

Question: Is there a way to lock the togglebutton after start and unlock via another way to then stop the activity?
An option could be to use a menu, but would like to stick to (visual) buttons to keep simple for usage.

Any hints appreciated.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…