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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:13:17+00:00 2026-05-31T07:13:17+00:00

I have implemented this broadcast reciever: public class ServiceManager extends BroadcastReceiver { private final

  • 0

I have implemented this broadcast reciever:

public class ServiceManager extends BroadcastReceiver {
    private final String BOOT_ACTION = "android.intent.action.BOOT_COMPLETED";
    private final String BOOT_ACTION_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH";
    private final String BOOT_ACTION_RESTARTED = "android.intent.action.PACKAGE_RESTARTED";

    @Override
    public void onReceive(Context context, Intent intent) {
        // All registered broadcasts are received by this
        String action = intent.getAction();
        if (action.equalsIgnoreCase(BOOT_ACTION) || action.equalsIgnoreCase(BOOT_ACTION_FIRST_LAUNCH) || 
                action.equalsIgnoreCase(BOOT_ACTION_RESTARTED)) {
             // TODO: Action
        } 
    }

}

AndroidManifest.xml

<receiver android:name="package.service.ServiceManager" >
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <action android:name="android.intent.action.PACKAGE_FIRST_LAUNCH" />
        <action android:name="android.intent.action.PACKAGE_RESTARTED" />
    </intent-filter>
</receiver>

The BOOT_COMPLETED action is working right, but, the PACKAGE_FIRST_LAUNCH and PACKAGE_RESTARTED are not working. I need to launch my broadcast receiver when I launch my app, that’s why I’m using these actions. But, when I launch or restart the app, the receiver is not working. It only works when I restart my mobile phone. Are there something wrong in my source?

  • 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-31T07:13:19+00:00Added an answer on May 31, 2026 at 7:13 am

    Logically it seems that PACKAGE_FIRST_LAUNCH will be broadcasted once your app is run for the first time after boot/reboot. And PACKAGE_RESTARTED should be broadcasted if your application activity stack is removed and then your app is clicked to start again (like restart).

    However, you may simply achieve this by broadcasting a custom action string when ever your app is launched (perhaps from your first activity).

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

Sidebar

Related Questions

I have a singleton implemented like this: class Test123(object): _instance = None def __new__(cls,
I have a class which has implemented INotifyPropertyChanged . This class UserInfo has a
So, I have implemented this method to add a footer to my table view:
I haven't yet implemented this, I'm still in the thinking stage, but I have
This is regarding AES algorithm. Suppose i have implemented a AES algorithm and encrypt
I was wondering how other people implemented this scenario. I have an internal rails
I have successfully implemented slider to my Cocos2D project using this resource . The
I have followed this article and implemented my service and I can open the
I have a web service implemented in WCF. This service is only going to
I have one desktop application which was implemented in C#. This app uploads file

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.