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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:21:52+00:00 2026-06-11T13:21:52+00:00

I have the Problem that I created a Service which should be created when

  • 0

I have the Problem that I created a Service which should be created when the AlarmManager wakes up. And actually it’s starting (onStartCommand is called, I see the toast), but same time in the log appears:

    09-19 02:48:32.537: I/ActivityManager(1983): START {flg=0x4 cmp=com.my.app/.syncService.SyncService (has extras)} from pid -1
    09-19 02:48:39.662: W/ActivityManager(1983): Unable to start service Intent { act=com.my.app.syncService.SyncService flg=0x4 (has extras) }: not found

Intent:

    Intent intent = new Intent("com.my.app.syncService.SyncService");
    PendingIntent pendingIntent = PendingIntent.getService(this, 12345, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    AlarmManager am = (AlarmManager)getSystemService(Activity.ALARM_SERVICE);
    am.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000*30, pendingIntent);

my Service looks like this:

public class SyncService extends Service{

    @Override
    public void onCreate() {
        Log.d("SyncService", "onCreate");
        Log.d("SyncService", "onCreate");
        Log.d("SyncService", "onCreate");
        super.onCreate();
        Toast.makeText(this, "Debug: SyncService created", Toast.LENGTH_LONG).show();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Toast.makeText(this, "Debug: SyncService onStartCommand", Toast.LENGTH_LONG).show();
        return super.onStartCommand(intent, flags, startId);
    }
}

AndroidManifest:

   <application>
       ...
       <service android:enabled="true" android:name="com.my.app.syncService.SyncService"/>       
   </application>

Isn’t it a bit strange? The onCreate get’s only called once, which makes sense to me, but the rest?

  • 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-06-11T13:21:53+00:00Added an answer on June 11, 2026 at 1:21 pm

    I think you can try change this line

     Intent intent = new Intent("com.my.app.syncService.SyncService");
    

    To

     Intent intent = new Intent(context,SyncService.class);
    

    Here, the context depends on where you create the AlarmManager

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

Sidebar

Related Questions

I have created a dialog and got a problem that only part of the
I have defined the following ApplicationManifest file the problem is that i have created
i have created one image but problem is that when i save image from
I have created a street view backbone view. The problem is that when shown,
I have a problem regarding Android App. I have created an application that download
The problem is, I have a DLL and TLB that I created in C#.NET,
I have created a puzzle which is a derivative of the travelling salesman problem,
I have a web service that was created several years ago in C++ and
I have created a class library that should connect to a WCF endpoint project
Problem I have an MSI that creates and starts a Windows service during installation

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.