How to password protect an application in Android -


i want user enter password everytime tries enter application. is, user must enter password everytime app comes foreground background, pressing launcher icon or long-pressing home key

i sort-of achieved first part because launcher intent fired , callback in onrestart of activity.

but long-pressing home key , launching not provide callback onrestart.

also if user launches app pressing notification from, notification bar. how distinguish whether app in background or fore-ground before user clicked notification

in onresume call, set logincounter += 1, in onpause -= 1.

if logincounter == 0 => show login dialog.

in notification bar set intent call activity, correct? add parameter "iscalledbynotificationbar" boolean in there.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -