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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:32:37+00:00 2026-05-26T04:32:37+00:00

Can’t register receiver dynamically at boot. I have no activity. And I do not

  • 0

Can’t register receiver dynamically at boot. I have no activity. And I do not want to register it in the service.

Boot Receiver where I register another receiver:

package zzz.zzz.zzz;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;

public class AutoStart extends BroadcastReceiver
{   
    @Override
    public void onReceive(Context context, Intent intent)
    {   
        if ((intent.getAction() != null) && (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")))
        {
            IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
            filter.addAction(Intent.ACTION_SCREEN_OFF);
            BroadcastReceiver mReceiver = new ScreenReceiver();
            context.registerReceiver(mReceiver, filter);
        }
    }
}

Receiver that I want to register:

package zzz.zzz.zzz;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ScreenReceiver extends BroadcastReceiver 
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) 
        {
            // some code            
        }
        if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) 
        {
            // some code        
        }
    }
}

LogCat:

10-12 15:03:45.849: ERROR/AndroidRuntime(240): Uncaught handler: thread Thread-8 exiting due to uncaught exception
10-12 15:03:45.859: ERROR/AndroidRuntime(240): android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents
10-12 15:03:45.859: ERROR/AndroidRuntime(240):     at android.app.ReceiverRestrictedContext.registerReceiver(ApplicationContext.java:126)
10-12 15:03:45.859: ERROR/AndroidRuntime(240):     at android.app.ReceiverRestrictedContext.registerReceiver(ApplicationContext.java:120)
10-12 15:03:45.859: ERROR/AndroidRuntime(240):     at zzz.zzz.zzz.RegisterReceiver$1.run(RegisterReceiver.java:18)
10-12 15:03:46.159: ERROR/ContactsProvider(98): Cannot determine the default account for contacts compatibility
10-12 15:03:46.159: ERROR/ContactsProvider(98): android.accounts.AuthenticatorException: bind failure
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1096)
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at android.accounts.AccountManager.access$500(AccountManager.java:74)
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at android.accounts.AccountManager$BaseFutureTask$Response.onError(AccountManager.java:1003)
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69)
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at android.os.Binder.execTransact(Binder.java:287)
10-12 15:03:46.159: ERROR/ContactsProvider(98):     at dalvik.system.NativeStart.run(Native Method)
10-12 15:03:46.879: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound
10-12 15:03:46.889: ERROR/MediaPlayer(52): Unable to to create media player
  • 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-26T04:32:37+00:00Added an answer on May 26, 2026 at 4:32 am

    The answer is in the error message: IntentReceiver components are not allowed to register to receive intents. You can’t register a new BroadcastReceiver in an existing BroadcastReceiver.

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

Sidebar

Related Questions

Can someone maybe tell me why this is not working? I have used echo
I have a jquery bug and I've been looking for hours now, I can't
Can anyone suggest how to underline the title of a UIButton ? I have
Can I be notified of the following events for an Activity: screenSizeWillChange screenSizeDidChange I
Can I have a project that has some parts written in c and other
Can you have submenus with the top level set to checkable in WPF? I
can someone show me the regex for this preg_match. I want to make sure
Can somebody point me to a resource that explains how to go about having
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can you cast a List<int> to List<string> somehow? I know I could loop through

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.