Heya!
This has started to do my head in, and I can't figure this out.
After many searches on google, i found several examples of how to programmatically/dynamically add rows to a TableLayout.
My customers.xml file.
My CustomersActivity.java:
My AndroidManifest.xml
Now, for some weird reason "findViewById" returns null. This is frustrating as hell since "customers_table" TableLayout is declared RIGHT THERE.
Am i missing something? Newbie here.
This has started to do my head in, and I can't figure this out.
After many searches on google, i found several examples of how to programmatically/dynamically add rows to a TableLayout.
My customers.xml file.
Code:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0,1"
android:id="@+id/customers_table" >
</TableLayout>
My CustomersActivity.java:
Code:
setContentView(R.layout.customers);
later on:
TableLayout tl = (TableLayout)findViewById(R.id.customers_table);
My AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.crmdeskapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_tab_support"
android:label="@string/app_name" >
<activity android:name=".CustomersActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name =".CustomerActivity">
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
Am i missing something? Newbie here.

It runs atleast.