no keypad for edittext in android - android

In my project I am not getting the keypad for EditText but if I type using the keyboard I am able to add the data but in emulator not keypad is visible.
Went to through this post and made changes but no luck.
my XML file
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/button1"
android:focusable="true"
android:focusableInTouchMode="true"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:text="Brokerage Detail" />
<ListView
android:id="#+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button2"
android:layout_alignParentLeft="true"
android:layout_below="#+id/button1" >
</ListView>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="AddStock" />
Please help me in solving this issue

You need to Edit your AVD and set both :
Keyboard Lid Support and Keyboard Support to YES
Then restart your AVD. May be it will work.
See avd image below:-
EDIT : To enable soft keyboard in Genymotion
Go to Settings -> Language & input and open the Default item under Keyboard & Input Methods. There is a Hardware setting that you can toggle on/off. When it is on you use your physical keyboard and when it is off the standard soft keyboard should pop-up whenever a text field gets focus.

Related

All my EditTexts in my app has a delay (short freeze) when clicking them before I can type

In my app I'm using EditText in a few different places. However, whenever I click any of these EditText's, the soft keyboard appears and then there is a short delay where it seems like everything freezes for about one or two seconds before I can type.
Same thing happens when I am done typing and click the back button, the soft keyboard disappears and then there is a white square instead where it took place and it again freezes for one or two seconds.
I have searched for it and I found this, I tried it but didn't change anything. What can be the cause for this and how can I fix it?
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:id="#+id/weekTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="#color/PaleBlack"/>
<RelativeLayout
android:id="#+id/desiredHoursContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#id/weekTextView"
android:layout_toRightOf="#+id/weekTextView">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/desiredHoursEditText"
android:layout_toStartOf="#id/desiredHoursEditText"
android:paddingEnd="5dp"
android:paddingRight="5dp"
android:text="#string/desired_hours"
android:textColor="#color/PaleBlack"/>
<EditText
android:id="#+id/desiredHoursEditText"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_toLeftOf="#+id/unitTextView"
android:layout_toStartOf="#+id/unitTextView"
android:background="#drawable/main_border_square"
android:inputType="number"
android:maxLength="2"
android:minWidth="40dp"
android:textAlignment="center"
android:textColor="#color/PaleBlack"/>
<TextView
android:id="#+id/unitTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingLeft="5dp"
android:paddingStart="5dp"
android:text="h"
android:textColor="#color/PaleBlack"/>
</RelativeLayout>
I fixed it by adding the following line to my activity in the manifest, not sure why tho.
android:windowSoftInputMode="adjustNothing"

Why is my EditText not editable?

Why is my EditText not editable?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background"
android:orientation="vertical"
android:textAlignment="center"
android:weightSum="2"
tools:context="com.example.musicvideomaker.ProjectSettingsX"
>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:text="Project Name"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:singleLine="true" >
<requestFocus />
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="50dp"
android:text="Save" />
</LinearLayout>
I run the app in the emulator and I can't change the EditText. The keyboard doesn't appear when I touch it. I have tried it on multiple emulators.
Your EditText is editable, but your emulator probably doesn't have keyboard support. You will need to edit the AVD to add an option as follows:
From Eclipse, Go to AVD Mananger.
Select the particular AVD and click on Edit
Go to the Hardware section, click on New.
Select the Property Name : Keyboard Support
By default, it is added with a value of 'no'. Just click on the value column and change it to 'yes'.
Click on Edit AVD again.
This will add a property hw.keyboard=yes in config.ini file for the AVD. And it should work fine from there.
I dont think its a code problem. I think its got something to do with the emulator itself. Avds are usually made to use input from your computer's physical keyboard, so try just typing on it, if you dont want to do that.
Go to AVD manager, click on your device, and click on edit.
See this:
Check/uncheck it as per your need.

Android Soft keyboard

Android Soft keyboard is not automatically switching to Alphabet mode from numeric mode during navigating to other text box, why?
android:inputType="select ur appropriate mode"
for your particular textbox
example ,shown below
<EditText
android:id="#+id/editText1"
android:inputType="text"=========returns text keyboard
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/editText1"
android:inputType="number"=======returns numeric keyboard
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
You have to use the inputType property to indicate what type of keyboard you want.
For example, say you have 2 edit boxes:
//alphabet keyboard is shown when user focus is on this box
<EditText
android:id="#+id/editText1"
android:inputType="text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
//numeric keyboard is shown when user focus is on this box
<EditText
android:id="#+id/editText2"
android:inputType="number"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

Strange error of dimensionally on the EditText after disabling the standard Android keyboard

in my app I have disabled the standard Android keyboard for each EditText with
myEditText.setInputType(0);
but now when I use the instruction:
myEditText.setText("string");
the sizes of my EditText does not fit to the size of the text you entered; so the text is not displaying in whole.
How can I fix this?
This is my xml:
<LinearLayout
android:layout_width="305dp"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="DECIMAL:"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25sp"
android:textStyle="bold" android:textColor="#000000"/>
<EditText
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
>
</LinearLayout>
If you want to disable editText then I recommend to use editText.setEnabled(false). Hiding keyboard is not the right solution until you really need it. But if you have disabled edittext then keyboard will not appear even if you focus on it.
I don't think problem is because of keyboard. One thing I observed in your code is, you are setting ems for editText. I think because of ems, editText size is constant always. Check this link for more information.

Android : Soft Keyboard covering edit text up (adjustresize or adjustpan doesnt work)

Android Developers...
I am new in developing android application. Thus, i really ask for a slow or details explanation about the problem:
As the title, the soft keyboard always covering up the edit text. Non of the adjustresize or adjustpan works.
I already search this problem, some people say to make the application not fullscreen. I already make my own simple theme which only consist:
false
still/ it doesnt work. Thus, how to disable full screen correctly?
Some people say to use scrollview. Is it the only answer for it? because i would rather to use relative or linear layout.
is there any simple answer to make the soft keyboard behaves well?
Thank you so much for your help :D
Ps:
android:minSdkVersion="7"
I am targetting for 2.1
There is no such implicit theme on my manifest that state the theme is fullscreen mode.
The awkward is: my login activity, the edittext is sliding up to make a room for the soft keyboard. but whenever this activity is called again, the sliding up for edittext does not working.
this is my activity xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/bgcolor"
android:orientation="vertical" >
<TextView
android:id="#+id/textTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:clickable="false"
android:layout_gravity="center_horizontal"
android:text="Transfer Tanpa Berita" />
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30dp"
android:text="No Rekening Tujuan: " />
<EditText
android:id="#+id/transferNoRek"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="number"
android:maxLength="20">
</EditText>
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30dp"
android:text="Jumlah: " />
<EditText
android:id="#+id/transferJumlah"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="number"
android:maxLength="20">
</EditText>
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30dp"
android:text="No HP Tujuan: " />
<EditText
android:id="#+id/transferNoHP"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:inputType="number"
android:maxLength="15">
</EditText>
<Button
android:id="#+id/transferButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Kirim"
android:onClick="validatePin">
</Button>
</LinearLayout>
I finally find the answer to my own problem.
I set android:windowSoftInputMode int the Tab Activity not the actual activity. In my opinion, its because the Tab activity is the one who calls other activities.
Thanks.

Categories

Resources