我可以这样做吗:
mBoradcastReciver = null;
void register(){
if(mBoradcastReciver == null){
mBoradcastReciver = new ...
registerReceiver(mBroadcastReceiver, ....);
}
}
void unregister(){
if(mBoradcastReciver != null){
unregisterReceiver(mBroadcastReceiver);
mBoradcastReciver = null;
}
和方法 register() 和 unregister() 每次我想要调用?这种方法有什么潜在的问题吗?