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 4564006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:26:24+00:00 2026-05-21T18:26:24+00:00

I am trying to start an activity at device bootup. Stranege thing is that

  • 0

I am trying to start an activity at device bootup.

Stranege thing is that my code is working on emulator but not on an actual device.

I have a file called preferences.xml which has a CheckBoxPreference to set the auto start on and off.

Here is my code :-

public class AutoStartUp extends BroadcastReceiver
{
private static final String TAG = "AutoStartUp";
public void onReceive(Context context, Intent intent)
{
    String action = intent.getAction();
    if(action.equals(Intent.ACTION_BOOT_COMPLETED))
    {
        SharedPreferences sp = context.getSharedPreferences("preferences", 0);
        if(sp.getBoolean("autostartup", false))
        {
            Log.e(TAG, "I AM HERE");
            Intent startupIntent = new Intent(context,  CompleteTaskManager.class);
            context.startActivity(startupIntent);
        }
    }
}
}

Here is my Manifest part for this receiver :-

<receiver android:name=".AutoStartUp" android:enabled="true" android:exported="false" android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
     <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
    </receiver>

Please Help!!

  • 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-05-21T18:26:25+00:00Added an answer on May 21, 2026 at 6:26 pm

    You can try this FLAG_ACTIVITY_REORDER_TO_FRONT
    http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_REORDER_TO_FRONT

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to start an activity from my main activity. Its not working
I'm trying to start an activity from a service running in background but its
I am trying to start activity at start up of phone but whole program
Hi I have a listview and, I am trying to start an activity from
I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound
I'm trying to start using LINQ and specifically LINQ to SQL but I'm having
I'm trying to start a service that has a argument that specifies a port
I am trying to start working with Excel documents through the OpenXML SDK Spreadsheet
So, i'm trying to start activity by sweeping across the screen, it works fine
Possible Duplicate: start Activity at startup of phone in android i am trying to

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.