Sub Activity_Resume
Dim in As Intent
in = Activity.GetStartingIntent
Log(in)
If in.HasExtra("from_shortcut") And in.GetExtra("from_shortcut") = True Then
Msgbox("Launched from shortcut", "")
Else if in.Action="android.intent.action.CREATE_SHORTCUT" Then
Dim shortcutIntent As Intent
shortcutIntent.Initialize("", "")
shortcutIntent.SetComponent("anywheresoftware.b4a.samples.test/.main")
shortcutIntent.PutExtra("from_shortcut", True)
Dim in As Intent
in.Initialize("", "")
in.PutExtra("android.intent.extra.shortcut.INTENT", shortcutIntent)
in.PutExtra("android.intent.extra.shortcut.NAME", "Shortcut Test")
in.PutExtra("android.intent.extra.shortcut.ICON", LoadBitmap(File.DirAssets, "small_logo.png"))
Activity.SetActivityResult(-1, in)
Activity.Finish
End If
End Sub