security - How to force killing application when minimizing in Android -
right i'm developing kind of password manager & generator application , done i'm facing problem seems bit hard solve.
in order yo improve security of app, added timer if user under inactivity app close. i'd close app every time user want minimize (pressing "home" button , "recent apps" button).
i've tried onstop()
, onpause()
nothing works because every activity on app when replaced moves through mentioned states. since can't use keycode == keycode.home
how that?
i suggest activities keep track of state in onresume() , onpause(): can increment static application-wide variable counting how many of activities visible. when count goes zero, means none of activities visible , can cleanup.
the solution proposed @don chakkappan not enough think, activity can reported active though it's no longer visible.
Comments
Post a Comment