Hi to everybody
I have recently used an App using PhoneSms in Phone library,with no problem. Now I want to send Sms with another App and I get (at runtime):
java.lang.IllegalArgumentException: MyApp...:
Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE,
an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons.
To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
The only difference that I see, between the two apps , is in the Manifest at:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
As a matter of fact, the working App has 33 instead of 35 in targetSdkVersion.
Of course I also have, in Manifest:
AddPermission(android.permission.SEND_SMS)
And I ask for permission at runtime:
Before the crash which happens at :
Changing 35 to 33 in the new App, makes it to work (despite I don't yet actually receive the sms, but It may be another problem)
Thanks in advance for any comment.
I have recently used an App using PhoneSms in Phone library,with no problem. Now I want to send Sms with another App and I get (at runtime):
java.lang.IllegalArgumentException: MyApp...:
Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE,
an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons.
To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
The only difference that I see, between the two apps , is in the Manifest at:
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
As a matter of fact, the working App has 33 instead of 35 in targetSdkVersion.
Of course I also have, in Manifest:
AddPermission(android.permission.SEND_SMS)
And I ask for permission at runtime:
B4X:
Dim rp as RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_SEND_SMS)
Wait For b4xPage_PermissionResult (Permission2 As String, Result2 As Boolean)
B4X:
Dim MySms as PhoneSms
MySms.Send(Number,Text) ...and also in MySms.Send2
Changing 35 to 33 in the new App, makes it to work (despite I don't yet actually receive the sms, but It may be another problem)
Thanks in advance for any comment.