AlertDialog shows wrong in landscape [duplicate] - java

This question already has answers here:
Disabling the fullscreen editing view for soft keyboard input in landscape?
(11 answers)
Closed 7 years ago.
I launch an AlertDialog in Android with an EditText field. When I use portrait orientation runs fine, but when I change to landscape the keyboard hides my alert. How I can I solve this?

In landscape, some android devices will cause the keyboard to fullscreen when the focus is on an editable feature of the layout (in your case, EditText).
You can flag the EditText to not fullscreen the keyboard in landscape in two ways:
XML: android:imeOptions="flagNoExtractUi"
Code: myEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);

Related

Dismiss Keyboard in Android Automatically [duplicate]

This question already has answers here:
Disable keyboard on EditText
(18 answers)
Closed 1 year ago.
I am trying to create calculator application in Android Studio using Java, I have EditText for showing result. When I focus this input Keyboard is showing. But I don't want to see keyboard in focus event as in normal calculator. Is there any way to solve this, or can I use other element either than EditText, I have used getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); in OnCreate method, but it doesn't work
EditText is desired to.. edit text. do you want to allow user for editing result?
if not just replace EditText with TextView and then any keyboard won't show up
if you still want this field to be editable then take a look a THIS QA, you will find there plenty of methods for blocking keyboard pop up automatically

Navigation Drawer Menu, Item Color [duplicate]

This question already has answers here:
Android - Navigation View item menu background color
(5 answers)
Closed 4 years ago.
when I open a navigation menu drawer project with Android Studio, it comes in Gray by default. I couldn't change them. How do I make color as in the picture?
Image
Your NaviagtigationView tag has a couple properties you can use.
app:itemTextAppearance="#style/Your.Style"
app:itemTextColor="#color/blue"

How to put gif in Button's background? Android [duplicate]

This question already has answers here:
Set Animated .GIF As Background Android
(3 answers)
Closed 4 years ago.
I would like to know how to put a gif in a Button's background on Android.
I already found out how to put a gif in an image view but I can't find any answer for my problem.
Buttons do not support gifs as a background resource.
Why does it has to be a button?
Just use an Image-View and react to an onClick event.

Android - Disable softkeybaord from poping up [duplicate]

This question already has answers here:
How to close/hide the Android soft keyboard programmatically?
(126 answers)
Closed 8 years ago.
I am programming for a Pidion device that is running Android 2.3.7 (Gingerbread). The Pidion comes with a built in keyboard and I would like to disable the softkeyboard from opening.
What is the best way to disable softkeyboard?
try this:
((EditText) findViewById(R.id.editTextReference)).setInputType(InputType.TYPE_NULL);
inside Activity you can do this:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
or inside Fragment you can just use
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

Disable Print Screen Button [duplicate]

This question already has answers here:
Disable Screenshot of my Swing Window
(5 answers)
Closed 9 years ago.
Can I disable the print screen button, while my application is on? Can we use the print screen button as one of the coded keyboard inputs, and equal it to do nothing?
There's no way to do this without affecting the Operating System settings via registry edits, etc.
A user can always unfocus your application, and press print screen taking a capture of the whole screen otherwise.

Categories

Resources