0

I made a calculator. Its working fine. I want to have touch focus in edittext but the problem is when i touch it the keyboard popup. How to disable keyboard?

Screenshot of Calculator

<EditText
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:gravity="bottom|end"
    android:textSize="40sp"
    android:enabled="true"
    android:singleLine="true"
    android:textIsSelectable="true"
    android:scrollHorizontally="true"
    android:id="@+id/tvExpression_ID"/>
Professor
  • 3
  • 3

3 Answers3

0

Use this in Manifest file android:windowSoftInputMode="stateAlwaysHidden" or set this for your edittext android:textIsSelectable="true"

0

I had the same issue before and this solution works for me

 <EditText
    android:focusableInTouchMode="true"
    android:cursorVisible="false"
    android:focusable="false"  />

Regards!

0

use this three line code to solve your issue

etText = findViewById(R.id.etText);
etText.setRawInputType(InputType.TYPE_CLASS_TEXT);
etText.setTextIsSelectable(true);
milan pithadia
  • 840
  • 11
  • 16