/** to initialise the UI */ private void initUI() { final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); toolbar.setTitleTextColor(getResources().getColor(R.color.white)); txtBusId = (TextView) findViewById(R.id.tripsummary_bus_txt); txtTime = (TextView) findViewById(R.id.tripsummary_time_txt); txtFrom = (TextView) findViewById(R.id.tripsummary_from_txt); txtTo = (TextView) findViewById(R.id.tripsummary_to_txt); txtTotalNoOfStudents = (TextView) findViewById(R.id.tripsummary_total_txt); txtNoOfStudentsBoarded = (TextView) findViewById(R.id.tripsummary_boarded_txt); txtNoOfStudentsMissed = (TextView) findViewById(R.id.tripsummary_missed_txt); // txtMessage= (TextView)findViewById(R.id.summary_studentsmessgae_txt); txtBusId.setText(mItem.getVehicleId()); txtTime.setText(mItem.getPlannedStartTime() + " - " + mItem.getPlannedEndTime()); txtFrom.setText(mItem.getFromArea()); txtTo.setText(mItem.getPlannedEndTime()); txtTotalNoOfStudents.setText(db_student.getStudentsList().size() + ""); txtNoOfStudentsBoarded.setText(db_student.getStudentsListWhereTrue().size() + ""); txtNoOfStudentsMissed.setText( (db_student.getStudentsList().size() - (db_student.getStudentsListWhereTrue().size())) + ""); // txtMessage.setText("Trip succesfully updated in server"); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_trip_summary); db_student = new DatabaseHandler(this); bundle = getIntent().getExtras(); mItem = (BusStopNameModel) bundle.getSerializable("item"); if (mItem != null) { // Log.d("", "item value name" + mItem.get); Log.d("", "item value name" + mItem.getBusStopCount()); Log.d( "", "item value name in tripsummary" + mItem.getFromArea() + mItem.getToArea() + mItem.getPlannedStartTime()); } initUI(); }