Android Open Source - SmartGlove List Adapter

From Project

Back to project page SmartGlove.


The source code is released under:

MIT License

If you think the Android project SmartGlove listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.smartgloveproject;
//w ww . j av  a 2  s. c o  m
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ListAdapter extends ArrayAdapter<Sms> {
  private final Context context;
  private final List<Sms> smsList;

  public ListAdapter(Context context, List<Sms> smsList) {
    super(context, R.layout.activity_main, smsList);
    this.context = context;
    this.smsList = smsList;
  public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.activity_main, parent, false);
    TextView senderNumber = (TextView)rowView.findViewById(;
    // senderNumber.setText(smsList.get(position).getNumber());
    Sms thisTxt = smsList.get(position);
    senderNumber.setText(thisTxt.getContactName() + " (" + thisTxt.getNumber() + ")");
    return rowView;

Java Source Code List