android-keypad

Android Keyboard hides EditText

社会主义新天地 提交于 2019-11-28 06:14:23
When I try to write something in an EditText which is at the bottom of the screen, the soft keyboard hides the EditText. How can I resolve this issue? Below is my xml code. I'm using this in a Fragment. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/linearLayoutTopDetails" android:layout_width="fill_parent" android:layout_height="wrap_content"

Keyboard overlapping EditText on click

戏子无情 提交于 2019-11-28 01:49:13
In my fragment I have an editText inside a scrollview and when I click on that I set it to open like this: getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); It works fine from the first time it opens, but when I close the keyboard and open it again, it overlaps the editText, how can I set the editText to always open in SOFT_INPUT_ADJUST_PAN mode? the XML: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas

How to add margin between EditText and Soft Keyboard?

萝らか妹 提交于 2019-11-27 22:58:20
问题 I want to add 10dp margin between EditText and Soft Keyboard. Here is my XML: <RelativeLayout android:id="@+id/BottomLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/bottom_glass" > <EditText android:id="@+id/message" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true

How to show Android keyboard with symbols mode by default?

断了今生、忘了曾经 提交于 2019-11-27 22:14:34
I have a EditText component, and, of course, if you click on it, the Android keypad is shown, allowing the user to input text. As far as I know, all Android software keyboards have (at least) a letter mode ( ABC ) and a symbols mode ( ?123 ). Their default view is the letter mode. Now when the keypad is shown when the EditText component is clicked, I want the symbols mode to be shown by default. The user will still be able to switch to the letter mode. Is there a way to achieve that? If yes, how? Vikram I'm posting this because I don't think any of the answers actually address the question.

how to make an android view scrollable when the keyboard appears?

若如初见. 提交于 2019-11-27 20:45:46
问题 I have a view with some fields (name, email, password, register button) : <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ViewFlipper android:id="@+id/viewflipper" android:layout_width="fill_parent" android:layout_height="wrap_content" > //Layouts </ViewFlipper> </ScrollView> When I focus an edittext field, the keyboard appears and is overlaying the lower fields on the view. So I can't see them

Prevent the keyboard from displaying on activity start

孤者浪人 提交于 2019-11-27 16:46:12
I have an activity with an Edit Text input. When the activity is initialized, the Android keyboard is shown. How can the keyboard remain hidden until the user focuses the input? I think the following may work getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); I've used it for this sort of thing before. Praveenkumar Try this also - this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); Otherwise, declare in your manifest file's activity - <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity

is there a default back key(on device) listener in android?

被刻印的时光 ゝ 提交于 2019-11-27 13:13:49
I am having two activities A and B. when i click the button in A that will shows B. when i click the Button in B it backs to A. i had set the overridePendingTransition method after the finish() method. it works properly. but in case the current Activity is B. on that time i click the default back button in the device. it shows the right to left transition to show the Activity A. How i can listen that Default back key on device? EDIT: Log.v(TAG, "back pressed"); finish(); overridePendingTransition(R.anim.slide_top_to_bottom, R.anim.hold); @Override public boolean onKeyDown(int keyCode, KeyEvent

Keyboard overlapping EditText on click

强颜欢笑 提交于 2019-11-27 04:49:25
问题 In my fragment I have an editText inside a scrollview and when I click on that I set it to open like this: getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); It works fine from the first time it opens, but when I close the keyboard and open it again, it overlaps the editText, how can I set the editText to always open in SOFT_INPUT_ADJUST_PAN mode? the XML: <?xml version="1.0" encoding="utf-8"?>

Page scroll when soft keyboard popped up

蓝咒 提交于 2019-11-27 03:22:18
I have a <ScrollView> layout: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <EditText android:id="@+id/input_one" android:layout_width="300dp" android:layout_height="wrap_content" android:layout_gravity="center" android:inputType="number" > <EditText android:id="@+id/input_two" android:layout_width="300dp"

Get Cursor Position in Android in Edit Text?

瘦欲@ 提交于 2019-11-27 03:10:28
I am using a custom EditText View. I have overridden the OnKeyUp event and am able to capture the Enter Key press. Now my requirement is, when the user has entered a text "Hi. How are you?" and then keeps the cursor after the word "are" and press enter, I need to get the cursor location so that i can extract the text after the cursor at the moment the Enter Key was pressed. Please let me know how to do this. Thank you for your time and help. You can get the Cursor position using the getSelectionStart() and getSelectionEnd() methods. If no text is highlighted, both getSelectionStart() and