-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Keyboard not showing #51
Comments
android:focusable="true" |
@rajatpathak, Given solution is not working. |
Any update ?, Same thing is happening with me |
same issue here |
Can anyone provide the reproduction steps? I tried to reproduce it on Android emulator 4.4 / 5.0 / 5.1 / 8.0 / 9.0, but it works perfect. |
in my case i forgot to follow step 2 in the wiki |
I have the same problem. I want to open the keyboard automatically when the Activity starts. MainActivity.cs public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
PinView pinView = findViewById(R.id.pinView);
pinView.requestFocus();
InputMethodManager inputManager = (InputMethodManager) pinView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.showSoftInput(pinView, InputMethodManager.SHOW_IMPLICIT);
}
} activity_main.xml <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<com.chaos.view.PinView
android:id="@+id/pinView"
style="@style/PinWidget.PinView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<requestFocus />
</com.chaos.view.PinView>
</LinearLayout> build.gradle
The This example reproduces the bug for my phone (Android 10) and on my emulator "Pixel 2 API 16". I hope this helps. |
For me, these two solutions are working pinView.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(pinView, InputMethodManager.SHOW_IMPLICIT);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); or pinView.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN , 0, 0, 0));
pinView.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP , 0, 0, 0));
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); |
Same problem |
but how to get This done if i have custom dilog box where i have placed this pinview |
this worked for me |
Same problem on 1.4.4 and try all solution of the all comment above still not working (Android 10 & pixel 5) |
|
works for me too |
me too |
Info:
The text was updated successfully, but these errors were encountered: