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
Post a Comment