I want to show dialog/popup when application in kill state and BroadcastReceiver
receive any action.
MyReceiver.java
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
MyDialog.showDialog(context);
}
}
I have added permission in manifest.
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
I am getting exception when activity foreground
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
My dialog is not display in activity kill state but receiver is called.