Android Question Finish Another Activity from Activity

Rasoull

Member
hi

I need if the user in the current activity changes the theme of the Application, close the previous activity and run it again, the following code works on most phones but does not work on some Android 10+ phones, is there an alternative has it?

B4X:
    Dim Jo As JavaObject
    Jo.InitializeStatic(Application.PackageName&"."&ActivityName.ToLowerCase)
    Jo=Jo.GetField("previousOne")
    If Jo<> Null Then
        Jo=Jo.RunMethod("get",Null)
        If Jo<>Null Then
            Jo.RunMethod("finish",Null)
'            LogColor(ActivityName & " Finished!",Colors.Red)
        End If
    End If
 
Top