fbritop Well-Known Member Licensed User Longtime User Feb 6, 2021 #1 In reference to Add pinned shortcut This code shows a dialog that lets the user add a shortcut on the home screen. You can modify the intent and add extra keys and values which can later be used by your app. Activity_Resume will be called when the shortcut is clicked. You can get the intent with Activity.GetStartingIntent... www.b4x.com I have set for example the intent value of "SCUT_TEST" B4X: Copy in.Initialize(in.ACTION_MAIN, "SCUT_TEST") in.SetComponent(Application.PackageName & "/.main") 'lower case builder.RunMethod("setIntent", Array(in)) Dim info As JavaObject = builder.RunMethod("build", Null) In the activty_resume sub, I have B4X: Copy Dim starting As Intent = Activity.GetStartingIntent Log("Action: "&starting.Action) Log("ExtrasToString: "&starting.ExtrasToString) But when I check the logs after clicking on the shortcut, the resume only logs empty for the action, and "no extras" for the ExtrasToString. I´m I missing something in the creation of the shortcut with the intent?
In reference to Add pinned shortcut This code shows a dialog that lets the user add a shortcut on the home screen. You can modify the intent and add extra keys and values which can later be used by your app. Activity_Resume will be called when the shortcut is clicked. You can get the intent with Activity.GetStartingIntent... www.b4x.com I have set for example the intent value of "SCUT_TEST" B4X: Copy in.Initialize(in.ACTION_MAIN, "SCUT_TEST") in.SetComponent(Application.PackageName & "/.main") 'lower case builder.RunMethod("setIntent", Array(in)) Dim info As JavaObject = builder.RunMethod("build", Null) In the activty_resume sub, I have B4X: Copy Dim starting As Intent = Activity.GetStartingIntent Log("Action: "&starting.Action) Log("ExtrasToString: "&starting.ExtrasToString) But when I check the logs after clicking on the shortcut, the resume only logs empty for the action, and "no extras" for the ExtrasToString. I´m I missing something in the creation of the shortcut with the intent?
fbritop Well-Known Member Licensed User Longtime User Feb 6, 2021 #2 Resolve it myself... if it helps anybody else B4X: Copy Dim in As Intent in.Initialize(in.ACTION_MAIN, "") in.SetComponent(Application.PackageName & "/.main") 'lower case in.PutExtra("QUICKOPEN", id) Upvote 0
Resolve it myself... if it helps anybody else B4X: Copy Dim in As Intent in.Initialize(in.ACTION_MAIN, "") in.SetComponent(Application.PackageName & "/.main") 'lower case in.PutExtra("QUICKOPEN", id)