I implemented "< category android:name="android.intent.category.BROWSABLE" />" in my browser app and i want any other browser showing the list to choose which app to handle that link in, its working fine i am able to launch my app from the list but however it doesnt load that url in my app, all it does is open my app and paste the url in the text field. any clue?
edit: i tried this one for loading url in my webview after pasting it but the app force closes
TextView uri = (TextView) findViewById(R.id.urlField);
//if (Intent.ACTION_MAIN.equals(getIntent().getAction())) {
String intentUri = (new Intent("com.example.browsableintent.MY_ACTION"))
.toUri(Intent.URI_INTENT_SCHEME).toString();
uri.setText(intentUri);
webView.loadUrl(intentUri);
Log.w("URLHandler", intentUri);
//} else {
Uri data = getIntent().getData();
if (data == null) {
uri.setText("");
} else {
uri.setText(getIntent().getData().toString());
}
//}
manifest
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.APP_BROWSER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="inline" />
<data android:mimeType="text/html" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/xhtml+xml" />
<data android:mimeType="application/vnd.wap.xhtml+xml" />
</intent-filter>
<!-- For viewing saved web archives. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
<data android:mimeType="application/x-webarchive-xml" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
LOG
02-11 17:50:48.678: E/AndroidRuntime(29023): FATAL EXCEPTION: main
02-11 17:50:48.678: E/AndroidRuntime(29023): Process: com.air.swiftmp, PID: 29023
02-11 17:50:48.678: E/AndroidRuntime(29023): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.air.swiftmp/com.air.swiftmp.MainActivity}: java.lang.NullPointerException
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread.access$800(ActivityThread.java:163)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.os.Handler.dispatchMessage(Handler.java:102)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.os.Looper.loop(Looper.java:157)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread.main(ActivityThread.java:5335)
02-11 17:50:48.678: E/AndroidRuntime(29023): at java.lang.reflect.Method.invokeNative(Native Method)
02-11 17:50:48.678: E/AndroidRuntime(29023): at java.lang.reflect.Method.invoke(Method.java:515)
02-11 17:50:48.678: E/AndroidRuntime(29023): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
02-11 17:50:48.678: E/AndroidRuntime(29023): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
02-11 17:50:48.678: E/AndroidRuntime(29023): at dalvik.system.NativeStart.main(Native Method)
02-11 17:50:48.678: E/AndroidRuntime(29023): Caused by: java.lang.NullPointerException
02-11 17:50:48.678: E/AndroidRuntime(29023): at com.air.swiftmp.MainActivity.onCreate(MainActivity.java:95)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.Activity.performCreate(Activity.java:5389)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
02-11 17:50:48.678: E/AndroidRuntime(29023): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)