Note that there are some explanatory texts on larger screens.

plurals
  1. POTextWatcher not working, what is wrong
    primarykey
    data
    text
    <p>The implementation of TextWatcher in the onCreate method is not working, I tried doing text typing using virtual keyboard and hardware keyboard present, also tried the code on emulator and real device. nothing seems to work.</p> <p>i even renamed the EditTexts in the layout and clean the project, re-build it, no hope</p> <p>any idea?</p> <p>here is the code</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.remarks); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); Intent i = getIntent(); Current_Language = i.getStringExtra("Lang"); Q1Rate = i.getFloatExtra("Q1Rate", 0f); Q2Rate = i.getFloatExtra("Q2Rate", 0f); Q3Rate = i.getFloatExtra("Q3Rate", 0f); Q4Rate = i.getFloatExtra("Q4Rate", 0f); Q5Rate = i.getFloatExtra("Q5Rate", 0f); LoadSettings(); NextBtnState(); final EditText edt_PhoneNo = (EditText) findViewById(R.id.edt_Remarks_PhoneNo); final EditText edt_Suggestions = (EditText) findViewById(R.id.edt_Remarks_Suggestion); edt_Suggestions.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void afterTextChanged(Editable s) { ShowToast("I Am Here Firas"); resetTimeout(); } }); edt_PhoneNo.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void afterTextChanged(Editable s) { ShowToast("I Am Here Firas"); resetTimeout(); } }); } </code></pre> <p>here is my ShowToast</p> <pre><code>public void ShowToast (String Msg) { Context context = getApplicationContext(); CharSequence text = Msg; int duration = Toast.LENGTH_LONG; Toast toast = Toast.makeText(context, text, duration); toast.setGravity(Gravity.CENTER|Gravity.CENTER, 0, 0); toast.show(); } </code></pre> <p>and here is the layout</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/Azure1" android:focusable="true" android:focusableInTouchMode="true" android:gravity="center_vertical" android:orientation="vertical" &gt; &lt;GridLayout android:id="@+id/Grid1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:columnCount="4" android:rowCount="4" &gt; &lt;Space android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;ImageView android:id="@+id/img_ClientLogo" android:layout_width="275dp" android:layout_height="145dp" android:layout_gravity="left" android:src="@drawable/general_client_logo" /&gt; &lt;TextView android:id="@+id/tv_CustomerSatisfactionSurvey" android:layout_width="948dp" android:layout_height="103dp" android:layout_column="3" android:layout_gravity="center" android:layout_margin="10dp" android:layout_row="0" android:gravity="center" android:text="@string/Customer_Satisfaction_Survey" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@color/OrangeRed2" android:textSize="50sp" /&gt; &lt;/GridLayout&gt; &lt;RelativeLayout android:id="@+id/ly_Stars" android:layout_width="match_parent" android:layout_height="379dp"&gt; &lt;EditText android:id="@+id/edt_Remarks_PhoneNo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/tv_Remarks_PhoneNo" android:layout_centerHorizontal="true" android:layout_marginTop="15dp" android:ems="10" android:hint="@string/Mobile_No" android:inputType="phone" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;TextView android:id="@+id/tv_Remarks_Suggestions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/edt_Remarks_PhoneNo" android:layout_centerHorizontal="true" android:layout_marginTop="25dp" android:text="@string/Any_Comment" android:textSize="25sp" android:textStyle="bold" /&gt; &lt;EditText android:id="@+id/edt_Remarks_Suggestion" android:layout_width="590dp" android:layout_height="wrap_content" android:layout_below="@+id/tv_Remarks_Suggestions" android:layout_centerHorizontal="true" android:layout_marginTop="15dp" android:ems="10" android:hint="@string/suggestion" android:inputType="textCapSentences|textMultiLine" android:singleLine="false" /&gt; &lt;TextView android:id="@+id/tv_Remarks_PhoneNo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="50dp" android:gravity="center" android:text="@string/Phone_Account_No" android:textSize="25sp" android:textStyle="bold" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:id="@+id/ly_NextPrevios" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" &gt; &lt;Button android:id="@+id/btn_Next" style="@style/ButtonText" android:layout_width="250dp" android:layout_height="100dp" android:layout_above="@+id/tv_PoweredBy" android:layout_alignParentRight="true" android:layout_marginBottom="10dp" android:layout_marginRight="45dp" android:background="@drawable/btn_blue" android:drawableRight="@drawable/arrow_right" android:onClick="Next_Page" android:text="@string/btn_Next" /&gt; &lt;TextView android:id="@+id/tv_PoweredBy" android:layout_width="772dp" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:gravity="center" android:text="@string/powerd_by_prime" android:textAppearance="?android:attr/textAppearanceMedium" android:textSize="16sp" /&gt; &lt;Button android:id="@+id/btn_Previous" style="@style/ButtonText" android:layout_width="250dp" android:layout_height="100dp" android:layout_above="@+id/tv_PoweredBy" android:layout_alignParentLeft="true" android:layout_marginBottom="10dp" android:layout_marginLeft="45dp" android:background="@drawable/btn_blue" android:drawableLeft="@drawable/arrow_left" android:onClick="Previous_Page" android:text="@string/btn_Previous" /&gt; &lt;ImageView android:id="@+id/img_help" android:layout_width="48dp" android:layout_height="48dp" android:layout_alignBottom="@+id/btn_Previous" android:layout_centerHorizontal="true" android:onClick="ShowHelpDialog" android:src="@drawable/help_64" /&gt; &lt;TextView android:id="@+id/tv_Steps" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/progressBar1" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:text="@string/Step6of6" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleHorizontal" android:layout_width="650dp" android:layout_height="20dp" android:layout_above="@+id/img_help" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:max="6" android:progress="6" android:progressDrawable="@drawable/my_progress" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload