Android Question FLAG_IMMUTABLE or FLAG_MUTABLE

Saeed Qatari

Member
Licensed User
This is only relevant for the issue with home screen widgets.

@Saeed Qatari please post the full error message from the logs, and the relevant code.
Logs:
Logger connected to: samsung SM-A725F
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
Device Token ID: e9MUfLfoSVueEqyp-PD3Ib:APA91bGxBHJvjla8KOaWtASJJ0zrZuiKRfhSW0wgAUFmEp0ZV-wrMqBkdvvRct2rnNjYhCrT1eNkLauib0Xx-ehD2hRATVEsU-pFdiUQmAjMRT8yDZHRzjIvbLrgqghioq1ZRyC6RyC_
Set timer.....
Error occurred on line: 19 (Global_Subs)
java.lang.IllegalArgumentException: com.eltizam3.emoya: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
at anywheresoftware.b4a.phone.Phone$PhoneSms.Send2(Phone.java:678)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:265)
at com.eltizam3.emoya.global_subs._sendsms_direct(global_subs.java:25)
at com.eltizam3.emoya.main._allbtn_click(main.java:1888)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7792)
at android.widget.TextView.performClick(TextView.java:16112)
at android.view.View.performClickInternal(View.java:7769)
at android.view.View.access$3800(View.java:910)
at android.view.View$PerformClick.run(View.java:30218)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Relevant Code:
'Code module
'Subs in this code module will be accessible from all modules.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim sms1 As PhoneSms
Dim phs As PhoneEvents
End Sub

Sub sendSms_intent(smsmsg As String, smsmobile As String)
Dim In As Intent
In.Initialize(In.ACTION_VIEW, "sms:" & smsmobile)
In.PutExtra("sms_body", smsmsg)
StartActivity(In)
ToastMessageShow(Main.smsdelv, True)
End Sub

Sub sendSms_direct(smsmsg As String, smsmobile As String)
sms1.Send2(smsmobile, smsmsg, True, True)
End Sub
 
Upvote 0
Top