Everytime someone comes up with 'b4a doesnt support this yet' you come up with a whole bunch of tutorials and examples!!!
I think hackhack was trying to create a shortcut from within his app.
Not sure if that is possible (or even right), looking at this method.
I know, my friend, I wasnt talking about you. Just a general thing I keep seeing on the forumsHey, I didn't say it couldn't do it - I was asking IF and HOW
Go ahead and try it and let us know if it does what you expected??? But surely the code posts from erel does exactly that! (And as I have written several times in the this thread, many other apps do that including "Astro")
Everything is already supported: http://www.b4x.com/forum/basic4andr...tcuts-your-android-application.html#post63900
Not quite as MakeShortCut(IntentToIssueOnClick,Name,Icon) though - unless that is Android.
I said it first! (although it wasnt my question)...but with your speed i have to say it again. Thanks Erel...I am still wondering how you are so fast!And for a moment I thought that you will write: "thank you for writing this tutorial to answer (or at least try to answer) my question".
you are welcomethank you for writing your tutorial
The one thing which is annoying to me if you move the shortcut creation routine out to the main app and run it then it doesn't work - it has to be created on call initiated from Android shortcut menu (the Honeycomb "more") - can that be avoided?
you are welcome
...just kidding, it wasnt me
anyways, hackhack can you tell me how Astro shortcut works? As far as I can see, you have to LongPress=>Shortcuts and add something from there. You cannot add shortcuts when you are inside the Astro application, can you?
Your intent doesnt know where to go. We know it is directed towards a launcher but you can have 10 launchers on your phone, which one does your intent go to?
I havent seen anyone do this yet, but maybe it is possible. (How to create home screen short cut? - Android Developers | Google Groups)
What I dont know if we can broadcast an intent or not? I thought StartActivity will broadcast an intent. (but that attempt went down the drain!)
Dim shortcutIntent As Intent
shortcutIntent.Initialize("", "")
shortcutIntent.SetComponent(Common.ShortcutPackage & "/.shortcutexec")
shortcutIntent.PutExtra("from_shortcut", True)
shortcutIntent.PutExtra("sc_type", SCType)
shortcutIntent.PutExtra("sc_value", SCValue)
shortcutIntent.PutExtra("sc_destination", SCDestination)
shortcutIntent.PutExtra("sc_toast", SCToast)
shortcutIntent.PutExtra("sc_notification", SCNotification)
shortcutIntent.PutExtra("sc_extra1", "")
shortcutIntent.PutExtra("sc_extra2", "")
Dim in As Intent
in.Initialize("", "")
in.PutExtra("android.intent.extra.shortcut.INTENT", shortcutIntent)
in.PutExtra("android.intent.extra.shortcut.NAME", txtName.Text)
in.PutExtra("android.intent.extra.shortcut.ICON", LoadBitmap(File.DirAssets, imageFN))
Accepting intents is not related to shortcuts. It is actually simpler.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?