Back to project page HeadphoneController.
The source code is released under:
GNU General Public License
If you think the Android project HeadphoneController 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 ca.mbabic.headphonecontroller.views; /* ww w.j a v a2 s . c o m*/ import java.util.ArrayList; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.RadioButton; import android.widget.TextView; import ca.mbabic.headphonecontroller.R; import ca.mbabic.headphonecontroller.models.HCCmd; /** * Array adapter for the display of HCCommands in a view. * * @author Marko Babic * */ public class CommandAdapter extends ArrayAdapter<HCCmd> { private ArrayList<HCCmd> mObjs; private Context mCxt; public CommandAdapter(Context context, int textViewResourceId, ArrayList<HCCmd> objects) { super(context, textViewResourceId, objects); mObjs = objects; mCxt = context; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater viewInflater; TextView textView; View view; HCCmd cmd; view = convertView; if (view == null) { viewInflater = (LayoutInflater) mCxt .getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = viewInflater .inflate(R.layout.select_command_list_item, null); } cmd = mObjs.get(position); textView = (TextView) view.findViewById(R.id.command_selection_label); textView.setText(cmd.getName()); return view; } }