java - Broadcast Receiver declaration in manifest error on intellij -
i'm developing android app using intellij 12.1.4. when create new android component type receiver receiver added manifest as
<receiver android:name=".receiver"> <intent-filter> <action android:name=" com.example.action_example"/> </intent-filter> </receiver>
but giving error "class or interface expected". tried put receiver including package name still same error. project compiles when broadcast sent intent filter associated receiver receiver receives nothing.
any please?
thanks in advance.
you have define intent-filter receiver
<receiver android:name="your receiver name"> <intent-filter> <action android:name="android.intent.action.boot_completed" /> //your action perform on broadcast receiver </intent-filter>
after in receiver class have check
if(intent(object of intent in onreceive method).equals("android.intent.action.boot_completed")) { // action perform }
Comments
Post a Comment