This question already has answers here:
How to stop EditText from gaining focus when an activity starts in Android?
(54 answers)
Closed 7 years ago.
When I travel between Activities my app auto select the first EditText field on the screen, calling the keyboard.
There is any way to start an Activity without selecting anything by default?
You should add this to its parent layout
android:focusable="true" android:focusableInTouchMode="true"
Related
This question already has answers here:
Android - Simulate Home click
(4 answers)
Closed 1 year ago.
How to programmatically, e.g. using a button, make the app switch to background mode. Actually, I mean the action that the "home screen button" does, but I want to programmatically do it on my button. Thanks.
finish();
System.exit(0);
Cause exited from app.
you can use below backstack function to move the app to background mode:
moveTaskToBack(true)
This question already has answers here:
How to stop EditText from gaining focus when an activity starts in Android?
(54 answers)
Closed 3 years ago.
I have edittext on my Xml layout. When the app launch, keyboard is coming and focusing to edittext. I dont want this. How can I unfocus it on Android Studio ?
set below property of your parent/Top level layout.
android:focusable="true"
android:focusableInTouchMode="true"
and Its working Nicely :)
Use this line in your activity it will hide your soft input
keyboardthis.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Alternatively, you can use
edittext.clearFocus();
Set this following line with your activity tag in manifest
android:windowSoftInputMode="stateHidden"
or
you can set following line in oncreate method of your activity
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
This question already has answers here:
How to add icons to items in a navigation drawer
(2 answers)
Closed 8 years ago.
Does anyone know how to add icons like this in the navigation drawer?
http://i.stack.imgur.com/JvzOb.png
(cant add images until I have 10 rep. points)
The content of the DraweLayoutis a ListView. So, you must set a custom adapter to the ListView, providing on the getView method the view desired. A good tutorial.
This question already has answers here:
How to pass an object from one activity to another on Android
(35 answers)
Closed 8 years ago.
I have an app MainActivity > ContactActivity > SummaryActivity
On MainActivity I have a text view with directions for the user and once they enter their information I want to get the results from SummaryActivity and post it on MainActivty page. Once the user inputs the information I want the instructions to disappear.
use bundle and pass as extra data with intent ...
see this thread
Passing data from one activity to another using bundle - not displaying in second activity
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Problem with Image Button visibility! Android
When you start the application, the buttons should be visible for 5 seconds and then become invisible, so people will know there are buttons on the screen. For example If I have a MapActivity running, the button will be an obstruction. So I want to make it invisible. It should be visible again on touching that area or around that button area so as to trigger another activity. I tried setting visibilitiy. nextbutton.setVisibility(View.INVISIBLE) I can't make it visible onTouch() Please help me with the problem.
See your original thread which has more than enough information for you to do what you want.