Reputation: 9
I am trying on a view as below:
Result: When I press on edit text, then there 2 keyboards which appear in order.
PS: THIS ISSUE DON'T HAPPEN WITH SINGLE EDIT TEXT!
Tested on device: Samsung A5, anroid 6.0.
Share screen shot and apk: https://drive.google.com/drive/folders/1Kw4DPk4iHtfXzVgrpTe4vzDwbRKvsy4X
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:ems="10"
android:inputType="number"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editText" />
Upvotes: 0
Views: 1108
Reputation: 530
what did you mean? on Single edit text two keyboard appear or two different keyboard appears on two edit text.
Note: I checked your app it show only number keyboard cause in edit text,<android:inputType="number"/>
Here Code which you need
editText.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_ENTER)
{
return true;
}
return false;
}
});
just add to your Activity.java
Upvotes: 1
Reputation: 6722
At first time ,when activity lunch add this line in AndroidManifest file to hide keyboard.
android:windowSoftInputMode="stateHidden"
android:configChanges="orientation|screenSize|keyboardHidden"
And add this line in EditText Property.
android:imeOptions="actionDone"
This will hide your keyboard and only show when you click on EditText of Particuler Type as input type is Number in your xml. Hope this will help you.
Upvotes: 0