这是我的代码的一部分。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
IntentFilter intent = new IntentFilter();
intent.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
registerReceiver(searchDevices, intent);
private BroadcastReceiver searchDevices = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String a="1";
}
}
class ClickEvent implements View.OnClickListener {
public void onClick(View v) {
// here , how to get Variables in a , I can't direct use of a
}
}
}