Show dialog alert from a non-activity class in android

后端 未结 7 2007
慢半拍i
慢半拍i 2020-12-06 02:37

I want to show an Alert Dialog via AlertDialogManager class to a non-activity class DeviceAdminReceiverSample\'s method onDisabl

7条回答
  •  囚心锁ツ
    2020-12-06 02:49

    The problem is 'You can show AlertDialogs from Activity only'. This is not an issue of context.

    Although this is not a good idea to show dialog from receiver (better is to use Notification), But if you want to do so you can create an Activity as dialog and show

提交回复
热议问题