流浪者Lonely 2017-03-15 02:40 采纳率: 50%
浏览 2014

Android 无法启动IntentService

测试环境安卓5.1

我在Activity按钮点击事件,启动IntentService

 Intent intent = new Intent(pda_login.this, pda_intentservice.class);
intent.putExtra("type", "login");
intent.putExtra("name", name);
intent.putExtra("password", password);
intent.putExtra("function", "ValidUserInfo");
//启动IntentService
 startService(intent);

一直进入不了onHandleIntent处理中,pda_intentservice类如下

 public class pda_intentservice extends IntentService {
    public pda_intentservice(){
        super("pda_intentservice");
    }

    @Override
    protected void onHandleIntent(Intent intent){
        //调用webservice
    }
}

AndroidManifest.xml中配置:

 <service android:name=".pda_intentservice"></service>

请各位大虾帮忙看看,小弟是菜鸟!在线等

  • 写回答

1条回答

  • 会飞的鱼大 2017-03-15 03:37
    关注

    需要设置package(service包名)

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作