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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:46:06+00:00 2026-06-01T17:46:06+00:00

I try to play with Service in Android, my application contain an Activity with

  • 0

I try to play with Service in Android, my application contain an Activity with a button so that it can do action when I press it.
The core component is the ExtractingURLService , which extends IntentService framework class.
I have overrided the onHandleIntent() method, so that it can handle intent passed to it properly.
Code:

public  class ExtractingURLService extends IntentService {

    private static final String TAG = "ExtractingURLService"; 

    public ExtractingURLService(String name) {
        super("ExtractingURLService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        // do something here !
        }
    }



}

The Android Manifest file is :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="example.service.urlextraction"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ServiceExample02Activity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service android:name=".ExtractingURLService" android:enabled="true"></service>

    </application>
</manifest>

In my only Activity class, I call the service by using:

Intent startServiceIntent =  new Intent(this, ExtractingURLService.class);
startService(startServiceIntent);

That’s all my work, but when deploy, the runtime error I received was:

04-09 16:24:05.751: ERROR/AndroidRuntime(1078): Caused by:
java.lang.InstantiationException:
example.service.urlextraction.ExtractingURLService

What I should do with that ??

  • 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-01T17:46:07+00:00Added an answer on June 1, 2026 at 5:46 pm

    Add full path of Service

    <service android:name="com.foo.services.ExtractingURLService" android:enabled="true"></service>
    

    Intent Service should look like this:

    package com.foo.services;
    
    import android.app.IntentService;
    import android.content.Intent;
    
    public class ExtractingURLService extends IntentService {
    
        private static final String TAG = "ExtractingURLService";
    
        public ExtractingURLService() {
            super("ExtractingURLService");
        }
    
        @Override
        protected void onHandleIntent(Intent intent) {
            // do something here !
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are trying to develop an app for Android where you can play a
So I created a view that has a button in it that will play
I'm using macincloud service to try/play/learn about building iPhone apps. I have a dummy
I'm writing an android application that searches for devices using the UPnP port 1900,
I have an application from where a play a radio stream using a service
I try open and play .wav files with NAudio lib. private OpenFileDialog openFileDialog =
i try to off a sound effect on my app play method is '
I try to restrict (using deadbolt ) something in my view ( play! framework
I want to try out Joda Time with Play Framework 2.0. So I have
I downloaded play-2.0.zip from the website. When I try to unzip it (using 7-zip),

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.