Android Question Translating Java intent code to B4A

toby

Well-Known Member
Licensed User
Longtime User
I want to open up my app's setting page via intent and the following code block is supposed to do just that. stackoverflow source

Could someone kindly translate it to B4A code, please?

Code: Copy
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivity(intent);

TIA
 
Solution
This works for me - note the different URI.
B4X: Copy
    Dim in As Intent
    in.Initialize("android.settings.APPLICATION_DETAILS_SETTINGS", "package:" & Application.PackageName) ' see the difference
    StartActivity(in)
This works for me - note the different URI.
B4X: Copy
    Dim in As Intent
    in.Initialize("android.settings.APPLICATION_DETAILS_SETTINGS", "package:" & Application.PackageName) ' see the difference
    StartActivity(in)
 
Upvote 2
Solution
This works for me - note the different URI.
B4X: Copy
    Dim in As Intent
    in.Initialize("android.settings.APPLICATION_DETAILS_SETTINGS", "package:" & Application.PackageName) ' see the difference
    StartActivity(in)
I tried it and it works indeed! Thank you so much and to keep you awake, I just sent you some coffee money.
 
Upvote 0
Back
Top