In Activity called NowePomieszczenie i made function pokazdane to
create new TableLayout and contain data (kosztorys\_id, kosztorys\_nazwa, inwestor) from database(bazakosztorys) in TableLayout's row (wiersz). Function is execute with the click button (wybierzkosztorys) like on attached image. It work good but table with database's data is not scrollable. How i can fix that ? 

*wyglad.setVerticalScrollBarEnabled(true);* is not working

<https://www.dropbox.com/s/ovqsyg990ymgsra/widok.jpg>

public class NowePomieszczenie extends Activity implements OnClickListener{

```
SQLiteDatabase db;
TextView textview1,textview2,textview3, textview4, textview5;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.nowe_pomieszczenie);
    db=openOrCreateDatabase("baza_kosztorys", MODE_PRIVATE, null);
}

```

public void pokazdane(View v)
 {

```
final Cursor c=db.rawQuery("SELECT * from kosztorys", null);
int count= c.getCount();
c.moveToFirst();

//definicja wygladu
final TableLayout wyglad = new TableLayout(getApplicationContext());
wyglad.setVerticalScrollBarEnabled(true);
TableRow wiersz = new TableRow(getApplicationContext());

//dodanie napisu id nad kolumna id
TextView textview = new TextView(getApplicationContext());
textview.setText("DOSTĘPNE KOSZTORYSY");
textview.setTextColor(Color.BLUE);
textview.setTypeface(null, Typeface.BOLD);
textview.setPadding(20, 20, 20, 20);
wiersz.addView(textview);

wyglad.addView(wiersz);

   for(Integer j=0; j<count; j++)
     {
        //przechwytywanie pierwszej kolumny
       wiersz = new TableRow(getApplicationContext());
       wiersz.setClickable(true);
       wiersz.setId(Integer.parseInt(c.getString(c.getColumnIndex("kosztorys_id"))));

     textview = new TextView(getApplicationContext());
     textview.setText(c.getString(c.getColumnIndex("kosztorys_id")));   
     textview2 = new TextView(getApplicationContext());
     textview2.setText(c.getString(c.getColumnIndex("kosztorys_nazwa")));
     textview3 = new TextView(getApplicationContext());
     textview3.setText(c.getString(c.getColumnIndex("inwestor")));

      wiersz.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                  int idrow=  v.getId();
                   v.setBackgroundColor(Color.GRAY);  

            }       
        }); 
   //  wiersz.addView(textview);
       textview2.setPadding(20, 20, 20, 20);
       textview3.setPadding(20, 20, 20, 20);

    // wiersz.addView(textview);
       wiersz.addView(textview2);
       wiersz.addView(textview3);
       wyglad.addView(wiersz);

       c.moveToNext();
     }
     setContentView(wyglad);
     db.close();

```

}