Forum Xamarin.Android

How should I write my explicit intent-filter in my receiver application ?

HSTan.0019HSTan.0019 USMember
edited October 2015 in Xamarin.Android

Application A

    Intent intent= new Intent ("com.example.ABC.redeem");
    intent.SetType ("text/plain");
    intent.PutExtra ("some.code", "SomeString");
    StartActivity (intent);

Application B
I have tried with these but my Application A keep threw me (No Activity found to handle Intent { act= com.example.ABC.redeem typ=text/plain (has extras) })

// How to write the intent-filter ?
[Activity (Label = "TestRewards", Name = "com.example.ABC.redeem")]         
[IntentFilter(
    new [] {Intent.ActionDefault},
    DataMimeType = "text/plain"
)]
public class TestRewards : Activity {...}

Answers

  • KeesPaulKeesPaul NLMember ✭✭

    Hi HS Tan,

    I have about the same problem. Did you solve it or find an answer somewhere?

  • HSTan.0019HSTan.0019 USMember
    edited December 2015

    @KeesPaul ,

    Maybe you can try to add "Categories". It works for me, but i'm not sure is the the proper way to do this.

    [IntentFilter(
            new [] {"com.example.packageName.xxx"},
            Categories = new[] {"android.intent.category.DEFAULT"},
            DataMimeType = "text/plain"
        )]
    
  • KeesPaulKeesPaul NLMember ✭✭

    I tried that, did not work for me. I opened a new question for this, but no response yet.

    Thanks anyway.

Sign In or Register to comment.