i was asked to make 2 textview in an xml file.. where i am suppose to fill the data into the two textview. but i onli manage to make a textview. tried alot of methods but jux cnt make 2 textview in the same xml file
here is the code in java
the below is the code in xml i only manage to get 1 done but doesnt know how to make the 2nd textview
here is the code in java
Code:
private void initModuleMCTable() {
cursor = dbHelper.fetchAllModuleMCs();
startManagingCursor(cursor);
if (cursor.getCount() == 0) {
Log.w(ModuleMCDatabaseHelper.class.getName(),"intit modulemc table");
dbHelper.createModuleMC("EG1011", "Mr Tan", "S441");
dbHelper.createModuleMC("EG1012", "Mr Tan", "S441");
dbHelper.createModuleMC("EG1013", "Mr Wong", "S442");
}
}
private void fillData() {
cursor = dbHelper.fetchAllModuleMCs();
startManagingCursor(cursor);
// Now create an array adapter and set it to display using our row
SimpleCursorAdapter modulesAdapter = new SimpleCursorAdapter(this,R.layout.list_item, cursor,
new String[] { ModuleMCDbAdapter.KEY_MODULE_CODE ,ModuleMCDbAdapter.KEY_MC},
new int[] { R.id.label});
setListAdapter(modulesAdapter);
}
the below is the code in xml i only manage to get 1 done but doesnt know how to make the 2nd textview
Code:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp"
android:gravity="center_vertical|center_horizontal"
>
</TextView>