AlertDialog from within BroadcastReceiver?? Can it be done?

后端 未结 5 1418
轻奢々
轻奢々 2020-11-28 13:53

AlertDialog from within BroadcastReceiver? Can it be done? I am working on a app that will pop up a Dialog box if I get SMS message. I am trying to code this within a Broa

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 14:41

    replace the word "this" inside the AlertDilaog with "context" -- the first parameter on you onRecieve method.

     public void onReceive(Context context, Intent intent)
    

提交回复
热议问题