diff --git a/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java index 0289a893f..685f66206 100644 --- a/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java +++ b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java @@ -22,6 +22,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; @@ -69,7 +70,12 @@ public void onClick(View v) { } }); - registerReceiver(new DynamicBroadcastReceiver(), new IntentFilter(INTENT_ACTION)); + DynamicBroadcastReceiver dynamicBroadcastReceiver = new DynamicBroadcastReceiver(); + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) { + registerReceiver(dynamicBroadcastReceiver, new IntentFilter(INTENT_ACTION), Context.RECEIVER_EXPORTED); + } else { + registerReceiver(dynamicBroadcastReceiver, new IntentFilter(INTENT_ACTION)); + } }