interrumpir enlace a mi aplicación
Tengo un problema. Estoy usando el siguiente código para interrumpir los enlaces a mi aplicación como
<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" android:host="twitter.com"/>
<data android:scheme="http" android:host="facebook.com"/>
</intent-filter>
Pero el problema es que necesito configurar el esquema de datos y el host en tiempo de ejecución, es decir, puedo agregar o eliminar el host en tiempo de ejecución. ¿Cómo establecer el valor del esquema de datos y el host en tiempo de ejecución? Estoy usando el código a continuación pero no funciona
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.VIEW");
filter.addCategory("android.intent.category.DEFAULT");
filter.addCategory("android.intent.category.BROWSABLE");
filter.addDataScheme("http");
filter.addDataAuthority("www.facebook.com", null);
RecieveBroadcaster receiver = new RecieveBroadcaster();
registerReceiver(receiver, filter);