在我的Android项目一类的调用对象是有MainActivity.java如何从其他
MainActivity extends FragmentActivity{
onCreate(Bundle savedInstanceState){
BluetoothManager bluetoothManager =
(BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
}
}
如何使用mBluetoothAdapter对象在下面的类
public class AvailableDevices extends ListFragment {
// How to call mBluetoothAdapter here
}
感谢
'BluetoothManager bluetoothManager =(BluetoothManager)getActivity()。getSystemService(Context.BLUETOOTH_SERVICE);' – EpicPandaForce 2014-10-20 12:08:58