Hi,
I have a number of broadcast receivers set up in my app to intercept the likes of text messages in and out. All it does is intercept, put a toast message saying "no you can't" and then InvokeAbortBroadcast() (or in the case of the start on boot, call the MainActivity).
The problem I'm having is that it seems like none of the broadcast receivers are working (set a debug point in the class handling the broadcast and it never gets hit - the correct permissions are set). When I build, I have the build to set on Automatic (changing this to internal does nothing from what I can see).
For each of the Intents I want to intercept, I have it's own class set (so I have one for start the app on boot, one for intercept messages, one for install/deinstall etc). Should this just be one class to handle all broadcasts or should it make no difference?
The receivers (more or less) all follow this code
[BroadcastReceiver]
[IntentFilter (new[] {Intent.ActionBootCompleted})]
class BootCompletedBroadcastMessageReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
if (intent.Action == Intent.ActionBootCompleted)
{
Toast.MakeText(context, "Hello - the app has hit the right place - now to launch the app", ToastLength.Long).Show();
context.StartActivity(typeof(MainActivity));
}
}
}
TIA
Paul