如何将BroadcastReceiver中的数据传递给activity
展开全部
public class LineActivity extends BaseActivity implements WifiInfoReceiver.ScanEnd{
private static final String TAG = "LineActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_line);
initView();
}
private void initView() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
WifiInfoReceiver receiver = new WifiInfoReceiver();
registerReceiver(receiver, intentFilter);
receiver.scanEndListen(this);
WifiManage.getIntance(this).startScan();
}
@
private static final String TAG = "LineActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_line);
initView();
}
private void initView() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
WifiInfoReceiver receiver = new WifiInfoReceiver();
registerReceiver(receiver, intentFilter);
receiver.scanEndListen(this);
WifiManage.getIntance(this).startScan();
}
@
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询