Back to project page BluetoothSPP.
The source code is released under:
MIT License
If you think the Android project BluetoothSPP 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 com.outofjungle.bluetoothspp.app; /*from w w w . j a v a 2s .c o m*/ import android.bluetooth.BluetoothDevice; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import java.util.ArrayList; public class DeviceAdapter extends ArrayAdapter<BluetoothDevice> { public DeviceAdapter(Context context, ArrayList<BluetoothDevice> devices) { super(context, R.layout.device_item, devices); } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.device_item, parent, false); } BluetoothDevice device = getItem(position); TextView deviceTextView = (TextView) convertView.findViewById(R.id.deviceTextView); deviceTextView.setText(device.getName() + "\n " + device.getAddress()); return convertView; } }