File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/src/main/java/com/termux/app Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3
3
import android .app .Activity ;
4
4
import android .app .AlertDialog ;
5
5
import android .content .DialogInterface ;
6
+ import android .content .res .Configuration ;
6
7
import android .text .Selection ;
7
8
import android .util .TypedValue ;
8
9
import android .view .KeyEvent ;
@@ -69,7 +70,10 @@ public void onClick(DialogInterface dialog, int which) {
69
70
}
70
71
71
72
dialogHolder [0 ] = builder .create ();
72
- dialogHolder [0 ].getWindow ().setSoftInputMode (WindowManager .LayoutParams .SOFT_INPUT_STATE_VISIBLE );
73
+ if ((activity .getResources ().getConfiguration ().hardKeyboardHidden & Configuration .HARDKEYBOARDHIDDEN_YES ) == 0 ) {
74
+ // Show soft keyboard unless hardware keyboard available.
75
+ dialogHolder [0 ].getWindow ().setSoftInputMode (WindowManager .LayoutParams .SOFT_INPUT_STATE_VISIBLE );
76
+ }
73
77
dialogHolder [0 ].show ();
74
78
}
75
79
You can’t perform that action at this time.
0 commit comments