Prashant Mali
- Forum posts: 1
Aug 6, 2016, 2:38:48 PM via Website
Aug 6, 2016 2:38:48 PM via Website
I used service in the application for make application continuously active at the background. It works all the version of android except in lollipop. Please help me for this. I used Alarm service for this. Please help
me for the lollipop device. In the menifest i used following
android:name=".MyTestService"
android:process=".Broadcast_alram"
android:exported="false" >
This is the Service.
public class MyTestService extends IntentService {
public MyTestService() {
super("MyTestService");
}
@Override
protected void onHandleIntent(Intent intent) {
// Do the task here
Log.i("MyTestService", "Service running");
// Toast.makeText(getApplicationContext(),"Start background",Toast.LENGTH_LONG).show();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
@Override
public IBinder onBind(Intent intent) {
return super.onBind(intent);
}
@Override
public void onDestroy() {
super.onDestroy();
Log.i("MyTestService", "Service Destroy");
}
}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.