How to keep the state of keyboard same of previous activity? - android

In my activity I have a list of images and one EditText. When I click the image, I use intent to display image in fullscreen activity. when I press the back button the keyboard does not in the same state. I mean when hide the keyboard it displays on its own. Please help me how to maintain the state of keyboard. Thanks in advance.

Put focus on edit text again when activity resumes again after back press in full screen image view.

save the state of keyboard on a class field boolean. than onresume of the previous actvity you set the keyboard to shown or hidden depending on the saved value.

Related

How to pass data from 2nd activity to 1st (Popup) without press back button and close button?

I want to call data of activity using popup. Let me explain in brief... when i click on EditText of a dialog box
when i click on EditText (Template) then it will open activity.
after i select one option and activity will finish and selected option's value will be set in EditText of Template.
Why not use a Button (perhaps with a drawable) instead of an EditText? This makes more sense because the user won't be typing anything into the EditText.
As for passing the data back and forth, just use startActivityForResult().

What means this button state when my activity starts?

When my activity starts the button starts as below image, seems that it is selected.
button seems to be selected http://kodeinfo.com/wp-content/uploads/2014/03/post4_1.jpg
Button seems to be selected but I don't select it neither on activity nor layout.
I had checked and this is not related to focus. I tried starting the activity with requestFocus() on a button and does not have the same behavior.
Does anyone knows what is that? What is this state for the button? I don't want this behavior in my app, but I'm not being able to understand the issue in my code because I don't know what this state is.

How to put a button on the default keyboard? I want a button that when is pressed, it chance to another activity

I have a EditText in my activity. I want that when the user finish the text, he can move to the next activity without press back button to hide the keyboard. I was wondering if there a way to put a button on softkeyboard to move to next activity.
(Sorry for bad english, its not my native language)
You can't add buttons to an existing keyboard. However, you can suggest a label and id for the custom IME action. See TextView.setImeActionLabel:
Change the custom IME action associated with the text view, which will be reported to an IME with actionLabel and actionId when it has focus.
You'll then have to call TextView.setOnEditorActionListener to provide a custom listener to listen for that IME event where you can then move to your next activity.

android make soft keyboard always visible

My activity has an EditText field and I want Soft Keyboard to be always visible in the activity. I set
android:windowSoftInputMode="stateVisible"
in the manifest, but it results in animated appearance of Soft Keyboard when the activity starts. I need SoftKeybard to appear in full size at exactly the same time when activity starts, without animation.
I don't think this is possible.
You can make the keyboard to automatically show when the activity or fragment is created but the keyboard will be dismissed when the user presses the backbutton.

Getting an event when user press back key for dismissing a softinput Keyboard in android

I want the event name which is called when user presses the back key to hide the keyboard and how we call the same. Because onKeyDown method for back press is only worked when keyboard is hidden.
Thanks in advance.
you can not get if virtual keyboard has been displayed or not directly. There is a workaround for this, in which we need to get window's available width, and Height and compare it with width and height values stored previously.
Whenever the soft keyboard is present, it is actually dismissed when back is pressed because when it shows up, it actually has focus. It has focus because its ideally being used by the user and needs focus.

Categories

Resources