В моем Android app Я должен отображать данные, взятые из таблицы в таблице макет. Я получаю данные, и когда я добавляю TableRaws в Таблица дает указатель Null. Я правильно экземпляр элементов в таблице, и я не могу определить ошибку. Мой фрагмент кода, как показано ниже ....Android загружает данные в макет таблицы во время выполнения
TableLayout tbl=(TableLayout) findViewById(R.id.dpl_tbl_lst);
if(!retailersList.isEmpty()){
//TableRow Hedding=(TableRow) findViewById(R.id.dpl_tbl_hdr);
//tbl.addView(Hedding);
for(int i=0;i<retailersList.size();i++){
Retailer RtlIns=retailersList.get(i);
TableRow tbl_rw=(TableRow) findViewById(R.id.dpl_tbr_cnt);
TextView sequence, custommerName, city, status;
sequence=(TextView) findViewById(R.id.dpl_txt_seq);
custommerName=(TextView) findViewById(R.id.dpl_txt_cus_nm);
city=(TextView) findViewById(R.id.dpl_txt_cty);
status=(TextView) findViewById(R.id.dpl_txt_sts);
sequence.setText(RtlIns.getPosition());
custommerName.setText(RtlIns.getName());
city.setText(RtlIns.getCity());
status.setText(RtlIns.getStatus());
tbl_rw.addView(sequence);
tbl_rw.addView(custommerName);
tbl_rw.addView(city);
tbl_rw.addView(status);
tbl.addView(tbl_rw);}
И мой стол расположение как ниже .....
<TableLayout
android:id="@+id/dpl_tbl_lst"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow
android:id="@+id/dpl_tbl_hdr"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textview3"
android:layout_width="@dimen/cell_width_0"
android:layout_height="@dimen/cell_h_h"
android:background="@drawable/cell_shape"
android:padding="@dimen/cell_pdn"
android:text="@string/list_sequense"
android:textColor="@color/white"
android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<TextView
android:layout_width="@dimen/cell_width_2"
android:layout_height="@dimen/cell_h_h"
android:background="@drawable/cell_shape"
android:padding="@dimen/cell_pdn"
android:text="@string/list_cust_name"
android:textColor="@color/white"
android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<TextView
android:layout_width="@dimen/cell_width_2"
android:layout_height="@dimen/cell_h_h"
android:background="@drawable/cell_shape"
android:padding="@dimen/cell_pdn"
android:text="@string/list_city"
android:textColor="@color/white"
android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<TextView
android:layout_width="@dimen/cell_width_1"
android:layout_height="@dimen/cell_h_h"
android:background="@drawable/cell_shape"
android:padding="@dimen/cell_pdn"
android:text="@string/list_status"
android:textColor="@color/white"
android:textSize="@dimen/normal_text"
android:textStyle="bold" />
</TableRow>
</TableLayout>
Может кто-то помочь мне в этом вопросе.
сообщение об ошибке сообщения logcat. –
Сообщение logcat пожалуйста. – PsyGik