安卓:无法启动服务的意图:没有发现? [英] Android: unable to start service intent: not found?

查看:412
本文介绍了安卓:无法启动服务的意图:没有发现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,我不是第一个onbe这个问题,但我尝试了许多解决方案,我发现没有一件作品......也许你会发现错误

错误(也来得如此没有的.class和/.Client取决于其他设置)

  

12-02 16:40:15.359:W / ActivityManager(74):无法启动服务   意向{行为= com.android.fh.EnOceanApp.Client.class}:未找到

在清单中,这是包含在应用程序中,从活动(试了一下还的活动,并与.Client     

在code中的onCreate()

  startService(新意图(这一点,Client.class));
 

  startService(新意图(this.getApplicationContext(),Client.class));
 

 意向意图=新的意图(com.android.fh.EnOceanApp.Client.class);
    this.startService(意向);
 

 意向意图=新的意图(com.android.fh.EnOceanApp.Client);
    this.startService(意向);
 

而现在,我没有一个想法了.... com.android.fh.EnOceanApp是包,Client.java服务类在这个包

和我忘了清单:

 <应用
        机器人:图标=@可绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME>
        <活动
            机器人:标签=@字符串/ APP_NAME
            机器人:名称=。EnOceanAppActivity>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.MAIN/>

                <类机器人:名称=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;

      <活动机器人:ListView控件NAME =
          机器人:标签=列表视图>
      < /活性GT;
      <活动机器人:名称=。GraphView
          机器人:标签=图形视图>
      < /活性GT;
      <服务
            机器人:名称=客户>< /服务> //使用和不使用,当然没有这种评论
    < /用途>
 

解决方案

所以..只是最终帮助他人或不:

我做了一个新的项目,复制源代码,并试图运行它的服务现在被发现。 是什么区别,或者换句话说:那我想,可能会给问题: 长包名称,或开始用com.android。的 的。在新的项目中,我只是选择了com.enocean

I know, I am not the first onbe with this problem, but I tried so many solutions, I have found and no one works... maybe you could find the error

The error (also came so without .class and with /.Client depending on other settings)

12-02 16:40:15.359: W/ActivityManager(74): Unable to start service Intent { act=com.android.fh.EnOceanApp.Client.class }: not found

In the manifest, this is included in application, out of activities (tried it also in activities and with ".Client"

The code in onCreate()

    startService(new Intent(this, Client.class)); 

or

 startService(new Intent(this.getApplicationContext(), Client.class));

or

Intent intent=new Intent("com.android.fh.EnOceanApp.Client.class");
    this.startService(intent);

or

  Intent intent=new Intent("com.android.fh.EnOceanApp.Client");
    this.startService(intent);

And now, I dont have an Idea anymore.... com.android.fh.EnOceanApp is the package, Client.java the service-class in this package

and the manifest I forgot:

  <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".EnOceanAppActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>      
        </activity>

      <activity android:name=".ListView" 
          android:label="List View">
      </activity> 
      <activity android:name=".GraphView" 
          android:label="Graph View">
      </activity>
      <service 
            android:name=".Client"></service> //with and without ., of course without this comment
    </application>

解决方案

So.. just to eventually help others or not:

I made a new project, copied the sources and tried to run it: the service was found now. What was the difference, or in other words: what do I think, might give problems: the long package name or the beginning with com.android... In the new project I just chose com.enocean

这篇关于安卓:无法启动服务的意图:没有发现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆