android – Intent Service永远不会被调用

我正在尝试Intent服务.这就是我用它来称呼它
Button updateLocation = (Button) findViewById(R.id.btnUpdateLocation);
        updateLocation.setonClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // Todo Auto-generated method stub
                Intent updateLocintent=new Intent(ImTracking.this,UpdateLocation.class);
                startService(updateLocintent);}});

但是在我的UpdateLocation类中,它永远不会碰到我的任何断点.

public class UpdateLocation extends IntentService{

    public UpdateLocation() {
        super("UpdateLocation");
    }


    @Override
    protected void onHandleIntent(Intent intent) {

                SharedPreferences prefs = getSharedPreferences("Settings",0);
                final String id = prefs.getString("ID","");
                DefaultHttpClient httpclient = new DefaultHttpClient();
                HttpPost httpost = new HttpPost(
                        "http://iphone-radar.com/gps/gps_locations");

                JSONObject holder = new JSONObject();
...

到底是怎么回事?

谢谢

PS.我正在使用它,因为我想用一个报警管理器来调用它.但是,在按钮单击时,我想显示一个进度对话框,我将在哪里放置意向服务的进度对话框? (到目前为止,我只有使用异步任务的经验)

解决方法

你在AndroidManifest.xml中有 declare your service吗?除非声明如下,否则不会调用它:
<manifest ... >
  ...
  <application ... >
      <service android:name=".ExampleService" />
      ...
  </application>
</manifest>

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...