Here I'm trying to implement an Android Application Dashboard where user press the exit button to be asked for a pin or a password to exit the application, or go to the home page.
You can not control the behaviour of the Home key whenever it is pressed the home screen will be shown however you can bring your application in foreground as soon as Home screen is shown.
When exit button is pressed then you can ask user to enter the credentials. you can do this either in alert dialog with custom layout or taking user to other activity.
You can use SharedPreference to store the credentials if the data is limited else SQlite.
That's what you are asking ?
Related
I want to make an android app where the user first has to enter the password and then is taken to the subsequent activities.
But the user is able to access the last opened activity through recent apps without entering password.
So I want that every time the app is opened through recent tabs the user gets guided back to the main_activity where he first has to enter the password.
A good option would be to logout the user whenever your other activities go onPause(), and then when the activities are created, send them to the password activity if they are logged out.
I have an android application, when user presses home or back key, android application will be minimized.
I want to open this application after pressing back or home key. (like long press in home key and selecting minimized app - I want application do this automatically).
What should I do? Please help me.
I guess what you need is Kiosk Mode.
it can disable Android features that can be used to leave your app. The following features are affected:
The back button
The home button
The recent apps button
The power button
The volume buttons
I'm trying to create an Android app that has a dialer tab at the top of the screen. When user presses the tab, it should display the phone dialer.
I have a requirement that that the back button and HOME key presses should be dropped (user shouldn't be allowed to exit the app).
Which is the best way to display the dialer? Is it essential to create my own dialer for this app?
Or can I somehow run the stock OEM dialer within my activity? If this is possible, I believe the user can just press the back key or HOME button and exit out of my app.
Please suggest an approach.
I want to know if a user has returned to my app.
I mean, if a user opens my app and then press home button (not back button) and sees his home screen then reopens my app using the launcher icon.
How can I determine that the user performed this action?
Is the onResume() method the right one for this?
I have an application that starts with a login screen and the goes to a gridview and continues the flow. When the user presses the Home Button I want to do something in such a way that when he starts [clicks in the .apk again] the application restores his PHP session id, identifying that he was logged, and goes straight to this other activity that manages the gridview...
In few words: the user press home button and when start the application again he is already logged in and goes directly to the activity he was...
You need to go through this which explains the different available data-storage mechanism in android.
For your problem the answer is here. You save a preference and when the user restarts you can check for the preference value and do whatever is needed.