Reputation: 11
I'm actually searching for a way to add dynamically some browsable intent-filters to an activity using a Broadcast Receiver, I've made this in my activity :
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.e("Message", "uri "+ intent.getData().getPath());
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
intentF = new IntentFilter();
intentF.addAction("android.intent.action.VIEW");
intentF.addCategory("android.intent.category.DEFAULT");
intentF.addCategory("android.intent.category.BROWSABLE");
intentF.addDataScheme("http");
intentF.addDataScheme("https");
intentF.addDataAuthority("*.google.fr", null);
registerReceiver(receiver, intentF);
}
But when I go to https://google.fr on chrome browser app, I'm not redirected to my app...
What am I doing wrong ?
Thanks.
Upvotes: 1
Views: 425