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

  • Home
  • SEARCH
  • 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 6877771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:28+00:00 2026-05-27T04:38:28+00:00

I have a blank HelloWorld Application: package tutorials.TestReceivers; import android.app.Activity; import android.os.Bundle; public class

  • 0

I have a blank HelloWorld Application:

package tutorials.TestReceivers;

import android.app.Activity;
import android.os.Bundle;

public class TestReceiversActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

With this BootReceiver.Java:

package tutorials.TestReceivers;

import android.content.BroadcastReceiver;

public class BootReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent arg1) {
    Intent intent = new Intent(context, TestReceiversActivity.class);
        context.startActivity(intent);    
    }
}

and this manifest:

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".TestReceiversActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver
            android-permission="android.permission.RECEIVE_BOOT_COMPLETED"
            android:name="development.TestReceiversActivity.BootReceiver" >
            <intent-filter >
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.SCREEN_ON" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

After running the application and closing it.

When I unlock screen (SCREEN_ON) nothing happend.

And when i boot the decive I’m getting next msg like:

“The application TestReceiversActivity (tutorials.TestReceivers process) stop unexpectedly. Try again”

  • 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-27T04:38:29+00:00Added an answer on May 27, 2026 at 4:38 am

    After a long time of frustration, I solved the problem above.

    The right way to register Boot Broadcast Receiver (and open activity according to it), is:

    Blank HelloWorld Application (TestReceiversActivity.java):

    package tutorials.TestReceivers;
    
    import android.app.Activity;
    public class TestReceiversActivity extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
        }
    }
    

    Another Boot Receiver Class (BootReceiver.java)

    package tutorials.TestReceivers;
    
    import android.content.BroadcastReceiver;
    public class BootReceiver extends BroadcastReceiver{
    @Override
    public void onReceive(Context context, Intent intent) {
             Log.d("DAVID", "Hi, Boot reciver was catch!");
             Intent i = new Intent(context, TestReceiversActivity.class);
             i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             context.startActivity(i);
           }
    }
    

    Note: You must set the flag to make it work!

    Set the manifest to:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="tutorials.TestReceivers"
          android:versionCode="1"
          android:versionName="1.0">
        <uses-sdk android:minSdkVersion="8" />
    
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
        <application android:icon="@drawable/icon" android:label="@string/app_name">
                <receiver android:name=".BootReceiver" >
                <intent-filter >
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                </intent-filter>
            </receiver>
            <activity android:name=".TestReceiversActivity"
                      android:label="@string/app_name">
                    <intent-filter >
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
            </activity>
        </application>
     </manifest>
    

    Enjoy!

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

Sidebar

Related Questions

I have a Customer class which has a representative field....this field is initially blank
I have used the SL business application template and added a new blank, empty
I have a strange problem with my Android app. When I start it from
I have a huge dictionary of blank values in a variable called current like
I have a SQL Report that insists on printing an extra blank page at
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have an access table which has some cells as blank ( no data
How to ignore blank elements in linq query I have a linq query var
I have the following code which works when i put it in any blank
I've just gone blank. I have a many to many relationship with three tables.

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.