2

I have a table of texts with each row having a text. I want to display a popup when one of the rows in the table is clicked. Does TableLayout in android support this? If so, is there an example?

ssk
  • 9,045
  • 26
  • 96
  • 169

2 Answers2

3

You can attach the onClickListener with the TextView in each row. Or you could set it directly on TableRow directly

android.widget.TableRow tableRow = ..
tableRow.setOnClickListener(new OnClickListener(){
    public void onClick() {
    }
});

OnClickListener

Rajdeep Dua
  • 11,190
  • 2
  • 32
  • 22
0

Programatically doing it i used this code inside onCreate method of my activity:

    row.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    //codigoo
                }
            });

I had to use the View.OnClickListener and the @Override or it wouldnt work!

Topo
  • 56
  • 6