Note that there are some explanatory texts on larger screens.

plurals
  1. POViews at TableRow disable TableRow's onClickListener
    primarykey
    data
    text
    <p>I am adding tableRow's dynamically into a tableLayout.</p> <p>Then, I am adding TextViews into TableRows, then, i have to click on the tableRow's corners to get the TableRow's onClickListener. That's because it's actually getting the TableRow's inside view's onClickListener.(textview's onclickListener)</p> <p>My code:</p> <pre><code>Cursor resultado = dh.fetchAllFornecedores();//buscando no banco resultado.moveToFirst(); for(int i=0;i&lt;resultado.getCount();i++){ TableRow tr= (TableRow) getLayoutInflater().inflate(R.layout.tablerowfornecedor, null); HorizontalScrollView hsc= (HorizontalScrollView)tr.getChildAt(0); LinearLayout linearl= (LinearLayout)hsc.getChildAt(0); tr.setClickable(true); tr.setOnClickListener(this); for(int j=0;j&lt;linearl.getChildCount();j++){ //para cada textfild dos Fornecedores TextView textv=(TextView)linearl.getChildAt(j); textv.setClickable(false); textv=(TextView)linearl.getChildAt(j); if(j==0)textv.setText(resultado.getString(resultado.getColumnIndex("nome"))); else if(j==1)textv.setText(resultado.getString(resultado.getColumnIndex("doc1"))); else if(j==2)textv.setText(resultado.getString(resultado.getColumnIndex("rua"))+", "+(resultado.getString(resultado.getColumnIndex("numero")))); else if(j==3)textv.setText(resultado.getString(resultado.getColumnIndex("id_fornecedor"))); } tl.addView(tr,tlp); trs.add(tr); resultado.moveToNext(); } </code></pre> <p>dh is my database class.</p> <p>How can i "disable" the click on my TableRow's inside views?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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