0

Here i have registered my .Reciever_

<receiver 
    android:name=".Reciever_"
    android:permission="com.paad.MY_BROADCAST_PERMISSION">
    <intent-filter >
        <action android:name="com.paad.action.NEW_LIFEFORM_"/>
    </intent-filter>
</receiver>

and i want to use this android:permission in my code but it is not working .

I am using this permission in my code

String requiredPermission = "com.paad.MY_BROADCAST_PERMISSION";

i want to send my ordered broadcast .

sendOrderedBroadcast( new Intent("com.paad.action.NEW_LIFEFORM_") , requiredPermission ) ;

program control is not going inside OnRecieve() method ?

Tushar
  • 95
  • 1
  • 5

1 Answers1

1

Check below link its same as like your problem....

How to set permissions in broadcast sender and receiver in android

In the manifest of the broadcast sender, a new permission should be declared:

<permission android:name="com.paad.MY_BROADCAST_PERMISSION"></permission>

<uses-permission android:name="com.paad.MY_BROADCAST_PERMISSION"/>

its same like your code

<receiver 
    android:name=".Reciever_"
    android:permission="com.paad.MY_BROADCAST_PERMISSION">
    <intent-filter >
        <action android:name="com.paad.action.NEW_LIFEFORM_"/>
    </intent-filter>
</receiver>

Thanks

Community
  • 1
  • 1
SBJ
  • 4,089
  • 3
  • 24
  • 27