BluetoothChat.java
package com.example.android.BluetoothChat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
public class BluetoothChat extends Activity {
private Button btn;
private ListView listView;
private int count = 0;// 控制循环的遍历
private int id = 0;// 主键
protected List<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();// 将listView添加的数据保存在list中
private int selectItemPosition = 0;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btn = (Button) findViewById(R.id.button1);
// 绑定XML中的ListView&#