Question

How to start a service in android using nested class when mobile is switched ON?

I have the package contains nested class.

package Name

com.android

  1. MainActivity
  2. BroadCastReceiver

I am trying to reboot my BroadCast receiver. But it doesn't work (getting Failed). I don't know if the reason is, because of any problems for nested classes.

 <receiver android:name="ConnectionReceiver"></receiver> 

<receiver android:name="com.android.MainActivity .BroadCastReceiver "> 
<intent-filter> 
<action android:name="android.intent.action.BOOT_COMPLETED" /> 
</intent-filter> 
</receiver> 

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top