I am working on a chat application. In that i need the keyboard to remain visible even after the user clicks the send button like in Whatsapp.
Try this one it will always show the keyboard in an specific activity, just state android:windowSoftInputMode="stateAlwaysVisible" in your Android Manifest.
<activity android:name=".MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateAlwaysVisible" />
Related
I want to display android app in full screen for tablets.
I thought of using view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); to hide navigation but the problem is that I have buttons in my view. If I hide navigation like this, every time user want's to click butto, on first click the menu shows up but the button isn't clicked.
I wouldn't care if the menu shows or not after click but I don't want users to ask to click twice to choose something.
What would be the suggested way to display my app in full screen?
use this code:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Just Edit your Manifest.xml file:
Use this code if you want to display all the Activities in Full Screen Mode:
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</application>
Use this code if you want to display some Activities in Full Screen Mode:
<activity
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</activity>
I hope this helps.
You can write this line in Activity on onCreate method :
this.requestWindowFeature((int)Window.FEATURE_NO_TITLE);
SYSTEM_UI_FLAG_HIDE_NAVIGATION will cause those navigation controls to just disappear.There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately.
I am developing an android app.I am using RelativeLayout for login page and adding a button at the bottom using android:layout_alignParentBottom="true", but whenever i am type into login box keypad is getting displayed and that login button is also getting shifted above the keypad.I want that button always to remain at the bottom.
How to achieve that?
Add android:windowSoftInputMode="adjustPan" to the related activity in AndroidManifest.xml.
<activity android:name="MyActivity"
android:windowSoftInputMode="adjustPan">
</activity>
Hope it works for you.
I'm trying to make a page in Android, that the keyboard is always display, even when the user is pressing the back button (in that case I would like the app to go back to the last page).
For example: The page that Facebook did when you are writing a post in there app.
Thanks!
Add android:windowSoftInputMode="stateAlwaysVisible" to your activity in the AndroidManifest.xml file:
<activity android:name=".MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="stateAlwaysVisible" />
In my application I have an activity that has an edittext in it, when the activity launches the edit text automatically is given a selected state and the keyboard appears immediately, the problem here is when this happens other parts of the activity the user sees become hidden, what I would like is that when the activity starts there is no focus on the edittext so that user can view other elements on the page and then decide if they would like to select the edittext and launch the keyboard, any help would go a long way thanks!
use android:windowSoftInputMode="stateHidden" in your manifest.xml file as
<activity android:name=".YourActivity" android:label="" android:theme="#android:style/Theme.NoTitleBar" android:windowSoftInputMode="stateHidden"/>
hope this help
I figured it out, you actually have to go into the manifest file and place android:windowSoftInputMode="stateHidden" in the activity tag for the activity you dont want the keyboard to automatically show up on, took some extensive searching but found it!
Let's say I have a basic widget with a button. When i click on this button I would like to display a input dialogue window, still on top of the home screen, where upon entering some value and clicking submit I will see the home screen again.
What I do now is to start an activity with a dialogue which is placed on top of the main activity in my application. Perhaps there is just a simple flag to hide the main activity?
Thankful for any help.
To answer my question, this is what needed to be put in the manifest for my dialog activity.
<activity android:name=".InputDialog"
android:launchMode="singleInstance"
android:theme="#android:style/Theme.Dialog"
android:excludeFromRecents="true">
</activity>