![]() |
|
| Programación y Desarrollo para Android Subforo exclusivo para temas de programación de software para PDAs y desarrollo de aplicaciones, interfaces, etc bajo Android |
«
Tema Anterior
|
Siguiente tema
»
|
|
Herramientas |
|
#1
|
||||
|
||||
|
Null Pointer Exception al añadir una fila en una tabla
XML:
Código:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout android:id="@+id/TableLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0">
</TableLayout>
</LinearLayout>
Código: Código:
TableLayout table = (TableLayout) findViewById(R.id.TableLayout1);
TableRow row = new TableRow(this);
TextView t = new TextView(this);
t.setText("lalallala");
row.addView(t);
table.addView(row,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
|
|
| Respuesta |
Estás aquí
|
||||||
|
||||||
«
Tema Anterior
|
Siguiente tema
»
|
|
Hora actual: 21:14:04 (GMT +1)
HTCMania: líderes desde el 2007





