public void fillWorkEntries(ArrayList<WorkEntry> workEntries) { try { TableLayout table = (TableLayout)WorkEntryScreenActivity.this.findViewById(R.id.resultDetail); //table.removeAllViews(); for (WorkEntry workEntry : workEntries) { TableLayout nestedtable = (TableLayout) LayoutInflater.from(this).inflate(R.layout.tabrow, null); TableRow bodyRow = (TableRow)nestedtablefindViewById(R.id.tableRow2, null); ((TextView) nestedtable.findViewById(R.id.attrib_value2)).setText(workEntry.getWorkRequestName()); ((TextView) bodyRow.findViewById(R.id.attrib_value5)).setText(workEntry.getActHrs()); //TableRow bodyRownext = (TableRow) LayoutInflater.from(this).inflate(R.id.tableRow3, null); ((TextView) nestedtable.findViewById(R.id.attrib_value3)).setText(workEntry.getActivity()); ((TextView) nestedtable.findViewById(R.id.attrib_value4)).setText(workEntry.getWorkEntryDesc()); table.addView(nestedtable); } Log.d(TAG, "Load Entries"); } catch (Exception e) { e.printStackTrace(); Log.e(TAG, e.toString()); } }
TableRow headerRow = (TableRow) layout.findViewById(R.id.header); TextView branchName = (TextView) layout.findViewById(R.id.branch_name); TextView branchNo = (TextView) layout.findViewById(R.id.branch_no); TextView branchPhoneNo = (TextView) layout.findViewById(R.id.branch_phone_no); TextView branchTimings = (TextView) layout.findViewById(R.id.branch_timings);
((TextView) infoLayout.findViewById(R.id.alias_name)).setText((String) alias.getSelectedItem()); ((TextView) infoLayout.findViewById(R.id.certificate_expiration)).setText(new SimpleDateFormat(context.getResources().getString(R.string.export_signed_package_date_format), Locale.US).format(certificate.getNotAfter())); X509Principal x509 = new X509Principal(x500Principal.getName()); //Because X509Principal parses the String for us ((TextView) infoLayout.findViewById(R.id.alias_certificate_name)).setText((String) x509.getValues(X509Name.CN).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_organizational_unit)).setText((String) x509.getValues(X509Name.OU).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_organization)).setText((String) x509.getValues(X509Name.O).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_city)).setText((String) x509.getValues(X509Name.L).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_state)).setText((String) x509.getValues(X509Name.ST).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_country)).setText((String) x509.getValues(X509Name.C).get(0)); } else { ((TextView) infoLayout.findViewById(R.id.alias_certificate_name)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("CN").get(null))).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_organizational_unit)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("OU").get(null))).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_organization)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("O").get(null))).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_city)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("L").get(null))).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_state)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("ST").get(null))).get(0)); ((TextView) infoLayout.findViewById(R.id.alias_certificate_country)).setText((String) ((Vector) getValues.invoke(x509Principal.cast(principal), x509Name.getField("C").get(null))).get(0));