Obsolete
Status Update
Comments
ga...@gmail.com <ga...@gmail.com> #2
I am also facing the same problem. Please look into it.
ga...@gmail.com <ga...@gmail.com> #3
Work around:
Set input type other than "InputType.TYPE_NULL"
<EditTextn>.setTextIsSelectable(true);
The above method is available API-14 onwards.
The above work around hides the soft keypad and also cursor will be visible.
Set input type other than "InputType.TYPE_NULL"
<EditTextn>.setTextIsSelectable(true);
The above method is available API-14 onwards.
The above work around hides the soft keypad and also cursor will be visible.
lu...@gmail.com <lu...@gmail.com> #4
[Comment deleted]
lu...@gmail.com <lu...@gmail.com> #5
I got the same problem after I called .setInputType(InputType.TYPE_NULL), the cursor disappeared.
ko...@gmail.com <ko...@gmail.com> #6
Use this workaround:
<EditText>.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View v, android.view.MotionEvent event) {
int inType = <EditText>.getInputType(); // backup the input type
<EditText>.setInputType(InputType.TYPE_NULL); // disable soft input
<EditText>.onTouchEvent(event); // call native handler
<EditText>.setInputType(inType); // restore input type
return true; // consume touch even
}
});
<EditText>.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View v, android.view.MotionEvent event) {
int inType = <EditText>.getInputType(); // backup the input type
<EditText>.setInputType(InputType.TYPE_NULL); // disable soft input
<EditText>.onTouchEvent(event); // call native handler
<EditText>.setInputType(inType); // restore input type
return true; // consume touch even
}
});
ma...@gmail.com <ma...@gmail.com> #7
Cursor is visible, but don't have ability to move it by touching on <EditTex> in Android 4.0+. Is any solutions?
ny...@gmail.com <ny...@gmail.com> #8
I have finally found a (for me) working solution to this.
First part (in onCreate):
mText.setInputType(InputType.TYPE_NULL);
if (android.os.Build.VERSION.SDK_INT >= 11 /*android.os.Build.VERSION_CODES.HONEYCOMB*/) {
// this fakes the TextView (which actually handles cursor drawing)
// into drawing the cursor even though you've disabled soft input
// with TYPE_NULL
mText.setRawInputType(InputType.TYPE_CLASS_TEXT);
}
In addition, android:textIsSelectable needs to be set to true (or set in onCreate) and the EditText must not be focused on initialization. If your EditText is the first focusable View (which it was in my case), you can work around this by putting this just above it:
<LinearLayout
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" >
<requestFocus />
</LinearLayout>
You can see the results of this in the Grapher application, free and available in Google Play.
First part (in onCreate):
mText.setInputType(InputType.TYPE_NULL);
if (android.os.Build.VERSION.SDK_INT >= 11 /*android.os.Build.VERSION_CODES.HONEYCOMB*/) {
// this fakes the TextView (which actually handles cursor drawing)
// into drawing the cursor even though you've disabled soft input
// with TYPE_NULL
mText.setRawInputType(InputType.TYPE_CLASS_TEXT);
}
In addition, android:textIsSelectable needs to be set to true (or set in onCreate) and the EditText must not be focused on initialization. If your EditText is the first focusable View (which it was in my case), you can work around this by putting this just above it:
<LinearLayout
android:layout_width="0px"
android:layout_height="0px"
android:focusable="true"
android:focusableInTouchMode="true" >
<requestFocus />
</LinearLayout>
You can see the results of this in the Grapher application, free and available in Google Play.
pd...@gmail.com <pd...@gmail.com> #9
[Comment deleted]
sh...@gmail.com <sh...@gmail.com> #10
the above solution worked for me as well,,,, I was struggling with this problem for hours....
an...@bellsoft.ru <an...@bellsoft.ru> #11
[Comment deleted]
an...@bellsoft.ru <an...@bellsoft.ru> #12
It worked not for all models. For example, doesn't work on CUBE U9GT2, android 4.0.3.
st...@gmail.com <st...@gmail.com> #13
It really helps a lot. Thanks.
go...@gmail.com <go...@gmail.com> #14
en...@google.com <en...@google.com>
an...@gmail.com <an...@gmail.com> #15
[Comment deleted]
an...@gmail.com <an...@gmail.com> #16
#14 e...@google.com:
How is this obsolete when the bug still exist? As of Android version 6.0, setting InputType.Null still disable the text cursor. And the work around above introduce it's own issues like the Android OS forcing a suggestion box on the screen!!!
How is this obsolete when the bug still exist? As of Android version 6.0, setting InputType.Null still disable the text cursor. And the work around above introduce it's own issues like the Android OS forcing a suggestion box on the screen!!!
an...@googlemail.com <an...@googlemail.com> #17
I still have this issue in several Android Versions e.g. 5.1.1 and 6.0!
Google, please solve issues reported to you instead of waiting several years and then setting it to "osolete"!
Thanks!
Google, please solve issues reported to you instead of waiting several years and then setting it to "osolete"!
Thanks!
er...@gmail.com <er...@gmail.com> #18
I am also facing this issue. But "editText.setTextIsSelectable(true);" works for me. Thanks..
ge...@gmail.com <ge...@gmail.com> #19
I'm facing the same issue, but both "editText.setTextIsSelectable(true);" and "mText.setRawInputType(InputType.TYPE_CLASS_TEXT); " don't work form me; still trying to find a solution.
Description
An activity has multiple EditText on a RelativeLayout.
All EditText have been
<EditTextn>.setInputType(InputType.TYPE_NULL);
I am intercepting and processing all soft keystrokes using my own soft keypad adapter, hence do not desire any Android soft keypad capability.
On prior versions of Android, the data entry cursor I-beam was present. On 4.0.3, the I-beam cursor is not present.
As I control all aspects of data entry, I am using
((EditText)v).setSelection(((EditText)v).getText().toString().length());
to position the cursor to the far right of each data entry field.
As an aside, since I desire an I-beam cusor, am not able to use any other InputType setting, as there appears to be NO MEANS of permanently suppressing or banning the system-supplied soft keypad.
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
should ban the soft keypad, but does not.
Likewise,
imm.hideSoftInputFromWindow(<EditTextn>.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
should also ban soft keypad on the specific <EditTextn> field, but does not.
Expected action when InputType is NULL: Display a cursor, as in all prior versions of Android,
OR
provide a methodology to permanently (per activity) ban the soft keypad, on any focus change, regardless of input type.