Android Softkeyboard enters numeric value into edittext very slowly

I have a TableLayout which contains a number of products. Each line contains a code, description qty, price, discount value, ..... Depending on the number of values ​​entered by the user, the cost of the discount, the number of discounts and some other values ​​will also be calculated.

when the user clicks on softTextText β„’, this key will also work fine, working fine

My problem is that the user presses the number keys very slowly to show in EditText.

For example, I press 3 from the keyboard, after 7 or 8 seconds it is displayed only in this particular editText. How can I reduce this time line ...

This is a picture of my product:

ProductImage

Please someone tell me why this is happening?

:

     for (int i = initil; i <end; i++) {
        .............
        ............
        final EditText txtQty = new EditText(this);
            txtQty.setHeight(1);
            txtQty.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 42));
            txtQty.setInputType(InputType.TYPE_CLASS_PHONE);
            txtQty.setImeOptions(EditorInfo.IME_ACTION_DONE);
            txtQty.setImeOptions(EditorInfo.IME_ACTION_NEXT);
            txtQty.setSelectAllOnFocus(true);
            txtQty.setTextSize(9);
            txtQty.setHint("0.0");
    //      txtQty.setOnEditorActionListener(new DoneOnEditorActionListener());
//          txtQty.setHighlightColor(R.color.green);
            tr.addView(txtQty); 

            InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            mgr.showSoftInput(txtQty, InputMethodManager.SHOW_IMPLICIT);

            mgr.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_IMPLICIT_ONLY);
            ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(txtQty.getWindowToken(), 0);

            txtQty.setOnEditorActionListener( new OnEditorActionListener() {
                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                    Log.i("KeyBoard" ,"Inside the Edit Text");
                    .............................
        } });
+5
1

Dynamic tablelayout:

main.xml:

<?xml version="1.0" encoding="utf-8"?>
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#C0C0C0">

  <RelativeLayout
     android:layout_width="fill_parent" android:paddingBottom="20dip"
     android:layout_height="fill_parent"
     android:background="#C0C0C0">

   <TableLayout android:id="@+id/contact_table"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@+id/contact_info_title"
      android:layout_marginTop="10dp"
      android:background="@drawable/bgwhite_selector">
      </TableLayout>
 </RelativeLayout>
</ScrollView>

TableLayout, XML :

<?xml version="1.0" encoding="utf-8"?>
      <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/lays"
            android:layout_width="wrap_content" android:background="@color/white"
            android:layout_height="wrap_content" android:orientation="vertical"> 

<TableRow    android:background="@color/white" android:layout_width="wrap_content"
            android:layout_height="wrap_content">

<TextView   android:text=">" 
            android:textSize="18dip" android:textStyle="bold"  android:layout_width="wrap_content" 
            android:layout_height="wrap_content" android:id="@+id/arrowText"/> 
  </TableRow>

 </LinearLayout>

sepearate Java:

contact_table = (TableLayout)findViewById(R.id.contact_table);

LayoutInflater inflater = getLayoutInflater();

for(int i = 0; i < contact_count ; i++) {
LinearLayout row = (LinearLayout)inflater.inflate(R.layout.table_row,contact_table, false);
TextView text = (TextView)row.findViewById(R.id.text);
text.setText(list_data.get(i).summary);
contact_table.addView(row);
  }

 for(int i=0;i<contact_table.getChildCount();i++){ 
final View row=contact_table.getChildAt(i);
row.setOnClickListener(new OnClickListener(){
    @Override
    public void onClick(View v){
        // TODO Auto-generated method stub
        row_id=contact_table.indexOfChild(row);
    }
});
}

Second for - , ,

    msg_title_text.setOnEditorActionListener(new DoneOnEditorActionListener());

Action:

    class DoneOnEditorActionListener implements OnEditorActionListener {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
            Log.v("*****************************", "Clicked");

            return true;    
        }
        return false;
    }
}
+4

All Articles