Android Question Add a bookmark to the browser via an Intent

alwaysbusy

Expert
Licensed User
Longtime User
I'm trying to build an intent to add a bookmark to the browser. Howerver it fails.

I try this in B4A
B4X:
myIntent.Initialize("android.intent.action.INSERT", "android.provider.Browser.BOOKMARKS_URI")
myIntent.putExtra("title", meTitle)
myIntent.putExtra("url", meURI)
StartActivity(myIntent)

This is the java code I found:
B4X:
public static final void saveBookmark(Context c, String title, String url) {
  Intent i = new Intent(Intent.ACTION_INSERT, android.provider.Browser.BOOKMARKS_URI);
  i.putExtra("title", title);
  i.putExtra("url", url);
  c.startActivity(i);
}

They mention something extra:

B4X:
put an <action android:name="android.intent.action.ACTION_INSERT" /> entry for the activity in the manifest

How could I do this in B4A?
 
Top