Skip to content

Commit

Permalink
避免热插卡时FC
Browse files Browse the repository at this point in the history
  • Loading branch information
pppscn committed Mar 18, 2021
1 parent 39c9c42 commit a8470fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/com/idormy/sms/forwarder/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ protected void onDestroy() {
Log.d(TAG, "onDestroy");
super.onDestroy();
//取消注册广播
unregisterReceiver(smsBroadcastReceiver);
try {
if (smsBroadcastReceiver != null)
unregisterReceiver(smsBroadcastReceiver);
} catch (Exception e) {
Log.e(TAG, "unregisterReceiver fail:" + e.getMessage());
}
}

public void logDetail(LogVo logVo) {
Expand Down

0 comments on commit a8470fe

Please sign in to comment.