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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:20:15+00:00 2026-05-23T22:20:15+00:00

i have a problem with a simple service. the service should run automatically, as

  • 0

i have a problem with a simple service. the service should run “automatically”, as i already know if boot completet.
i’ve found a simple example and my code is the same but it doesnt work, there is nothing in the log. here is the example [Start Service at Boot][1]

package com.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class MainService extends Service
{
    public IBinder onBind(Intent intent)
    {
        return null;
    }

    @Override
    public void onCreate()
    {
        Log.v("StartServiceAtBoot", "StartAtBootService Created");
    }

    @Override
    public void onStart(Intent intent, int startId)
    {
        Log.v("StartServiceAtBoot", "StartAtBootService -- onStart()");
    }

    @Override
    public void onDestroy()
    {
        Log.v("StartServiceAtBoot", "StartAtBootService Destroyed");
    }

}


  [1]: http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/

here the braodcast receiver for the Boot-completed Action:

package com.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MainServiceReceiver extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED))
        {
            Log.i("Test", "Test");
            Intent i = new Intent();
            i.setAction("com.service.MainService");
            context.startService(i);
        }
    }
}

and here the manifest file:

     <?xml version="1.0" encoding="utf-8"?>
     <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.service"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-        permission>

    <application android:icon="@drawable/icon" android:label="@string/app_name">

        <service android:name="com.service.MainService">
            <intent-filter>
                    <action  android:name="android.action.intent.BOOT_COMPLETED">   
            </action>
        </intent-filter>
    </service>

<receiver android:name="com.service.MainServiceReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED">
        </action>
        <category android:name="android.intent.category.HOME">
        </category>
    </intent-filter>
</receiver>

</application>

in the android error log there is always this error:

9009 Applications Change Receiver updating1 application packageName = com.service….

please help me i think its a little thing but I dont see the mistake.

Thank you

  • 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-23T22:20:16+00:00Added an answer on May 23, 2026 at 10:20 pm

    In your code:

    Intent i = new Intent();
    i.setAction("com.service.MainService");
    context.startService(i);
    

    But at in manifest you have not declared intent-filter to receive this action.

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

Sidebar

Related Questions

enter code here Hi All, I have a simple windows service application that connects
I have a simple problem when querying the SQL Server 2005 database. I have
i have very simple problem. I need to create model, that represent element of
I have a problem with a simple included file. The file being included is
Seems like a simple problem: I have an SVN repo inside our firewall. I
I have a very simple problem which requires a very quick and simple solution
I have a very simple problem and a solution that will work, but I'm
I have a seemingly simple problem though i am unable to get my head
I have a problem where I always need to give simple access to my
Ok, simple problem hopefully. I have started to make a simple server for a

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.