Back to project page BusTicketer.
The source code is released under:
Copyright (c) 2013, Nelspike All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Red...
If you think the Android project BusTicketer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package bus.ticketer.listeners; /*w w w .j a v a 2s . c om*/ import java.util.ArrayList; import bus.ticketer.objects.Ticket; import bus.ticketer.passenger.BusTicketer; import bus.ticketer.passenger.R; import android.content.Context; import android.util.SparseArray; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; public class RadioGroupListener implements OnCheckedChangeListener { private SparseArray<ArrayList<Ticket>> tickets; private TextView text; public RadioGroupListener(Context context, TextView text) { this.tickets = ((BusTicketer) context.getApplicationContext()).getTickets(); this.text = text; } @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.t1_radio: text.setText(tickets.get(1).size() + " tickets"); break; case R.id.t2_radio: text.setText(tickets.get(2).size() + " tickets"); break; case R.id.t3_radio: text.setText(tickets.get(3).size() + " tickets"); break; default: break; } } }