Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:25:41+00:00 2026-06-13T01:25:41+00:00

I need my app to start running (in the background) after rebooting the device.

  • 0

I need my app to start running (in the background) after rebooting the device. Here’s what I’ve come up with till now (after taking a lot of help from here…)

This is my BootUpReceiver making use of broadcastreceiver:

public class BootUpReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Intent serviceIntent = new Intent(context, RebootService.class);
        serviceIntent.putExtra("caller", "RebootReceiver");
        context.startService(serviceIntent);
    }
}

This is the service class:

public class RebootService extends IntentService{

    public RebootService(String name) {
        super(name);
        // TODO Auto-generated constructor stub
}

protected void onHandleIntent(Intent intent) {

        Intent i = new Intent(getBaseContext(), MainActivity.class);  
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        String intentType = intent.getExtras().getString("caller");
        if(intentType == null) 
            return;
        if(intentType.equals("RebootReceiver")) 
            getApplication().startActivity(i);            
    }
}

THis is my android manifest:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <receiver
        android:name=".BootUpReceiver"
        android:enabled="true"
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </receiver>

    <service android:name=".RebootService"/>
</application>

The problem is, When I install this on my phone and reboot, the app crashes: It says, “Transfer has stopped working”. After I press the OK button, when I check the app info, the app is running.

I’m new to android and I’m not sure what is going on. Am I supposed to add any more permissions?

Kindly help.
TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:25:43+00:00Added an answer on June 13, 2026 at 1:25 am

    I think your problem lies with your RebootService constructor. When the system invokes it, it doesn’t provide any arguments, so it’s going to crash. If you look in the logs you’ll probably see something to the effect of “Unable to instantiate service…”

    Try replacing your constructor with:

    public RebootService() {
        super( "Reboot Service" );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create app for a Symbol MC70 device running Windows Mobile 5.0
I need to start a copy of a Rails app from within Java. I
In my app, I need to set a variable for a start time to
I need my app to show as full screen. Now I know how to
Here is the situation: I had an app with a cold start time of
I need to start the activity AlarmReceiver after 10 seconds (for example). I need
I have two scenarios here. One is, my App is active in the background
I'm struggling to get Sphinx back up and running after deploying a rails app
I need to make an app that will run forever at the background and
Just start to develop with devise for my app authentication, however running into trouble

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.