Change SMS App Default on Android 4.4.2

后端 未结 2 1376
野的像风
野的像风 2021-02-11 04:19

I would change default sms app on Android 4.4.2

I use this code:

Intent sendIntent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
sendIntent.         


        
相关标签:
2条回答
  • 2021-02-11 04:50

    It seems that if you want your app to appear in default sms app settings, you must first make it eligible, or else you can not set your app as default sms app. I had the same problem so I did those simple steps and then I could chose my app as default, in settings and in my code, which I could not before.

    So :

    • You must Have an Activity including an intent filter with an ACTION_SENDTO ("android.intent.action.SENDTO" ) and with schemas sms, smsto, mms, and mmsto. Do it in your manifest file. What I did was creating an empty activity that I will not use, with those parameters.

    • Do the same, by creating an empty Service including an intent filter with ACTION_RESPOND_VIA_MESSAGE ("android.intent.action.RESPOND_VIA_MESSAGE") and with schemas, sms, smsto, mms, and mmsto. This service must also require the SEND_RESPOND_VIA_MESSAGE permission. You must add all required permissions in your manifest.

    • Create an empty BroadcastReceiver including an intent filter with WAP_PUSH_DELIVER_ACTION ("android.provider.Telephony.WAP_PUSH_DELIVER") with the MIME type application/vnd.wap.mms-message. The broadcast receiver must also require the BROADCAST_WAP_PUSH permission. You must add all required permissions in your manifest.

    • Create an empty BroadcastReceiver including an intent filter with SMS_DELIVER_ACTION ("android.provider.Telephony.SMS_DELIVER"). The broadcast receiver must also require the BROADCAST_SMS permission. You must add all required permissions in your manifest.

    It important to set all these parameters without missing one. Once you made all these steps, your app will be eligible and you can then set it as default sms app, leaving those created classes empty, and sticking with you old way of doing things. The goal is simply set your app as default, so it will be fully fonctionnal like it was before, without code modification.

    0 讨论(0)
  • 2021-02-11 05:11

    I would change default sms app on Android 4.4.2

    You cannot change the default SMS app. You can, however, ask the user to change the default SMS app, using Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT. This is covered in the official blog post on the SMS changes in Android 4.4.

    0 讨论(0)
提交回复
热议问题