Creating Boot Receiver in android.....
This article shows how to create Boot Receiver in Android.
1- Create BootReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED))
//Make your stuff
}
}
2- Register it to Menifest.xml
<receiver android:name="com.example.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
2- Write this permission to Menifest.xml
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
2- Write this permission to Menifest.xml
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
0 comments :
Post a Comment