-2
根据我在BroadcastReceiver中的用例,我得到的布尔值是true或false。然后我将这个价值广播给我的活动。以下是我的代码如何接收Activity中的数据
boolean flag12 = MtpClient.isUSBDevice(usbDevice);
Bundle extras = intent.getExtras();
Intent i = new Intent("broadCastName");
intent.putExtra("MYMTP",flag12);
mContext.sendBroadcast(intent);
如何在活动中接收此内容。我需要在我的活动中再创作一个广播吗?因为我在做同一活动的sendBroadcast。
感谢