未找到可处理意图/不发射活动活动发现清单文件问题 [英] No activity found to handle Intent/no launcher activity found manifest file issue

查看:171
本文介绍了未找到可处理意图/不发射活动活动发现清单文件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的问题球员,首先我试图运行我的作为发射行动(运行配置 - > Android的 - >启动操作)启动默认的活动申请,logcat中不停地告诉我,它无法找到发射活动并且应用程序不会甚至开始,问题是,我在manifest文件中定义我的发射活动,但它像它不读它。

所以,我试图通过明确告诉它贯穿配置来运行它启动飞溅的活动,它没有推出,但过渡到再次崩溃下一个活动期间,logcat的说,没有活动发现,再次处理的意图,我定义我在其他应用程序做的方式和工作好吗那里。 Plase帮助它是一场噩梦。

这里的code为在MainActivity:

 进口android.app.Activity;
进口android.content.Intent;
进口android.os.Bundle;
公共类MainActivity延伸活动{@覆盖
保护无效的onCreate(捆绑savedInstanceState){
    super.onCreate(savedInstanceState);
    的setContentView(R.layout.activity_main);
螺纹定时器=新的Thread()
{
    公共无效的run(){
        尝试{
            睡眠(6000);
        }赶上(InterruptedException的E){
             e.printStackTrace();
        } {最后
            意图openStarting =新意图(totaltrainer.com.WorkoutPlace);
            startActivity(openStarting);
        }
    }
};
timer.start();
}
@覆盖
保护无效的onPause(){
    // TODO自动生成方法存根
    super.onPause();
    完();
}
}

和清单:

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=totaltrainer.com
安卓版code =1
机器人:=的versionName1.0><用途-SDK
    安卓的minSdkVersion =8
    机器人:targetSdkVersion =15/><应用
    机器人:allowBackup =真
    机器人:图标=@绘制/ ic_launcher
    机器人:标签=@字符串/ APP_NAME
    机器人:主题=@风格/ AppTheme>
    <活动
        机器人:名字=。MainActivity
        机器人:标签=@字符串/ APP_NAME>
        &所述;意图滤光器>
            <作用机器人:名字=totaltrainer.com.MAIN/>            <类机器人:名字=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
    <活动
        机器人:名字=。WorkoutPlace
        机器人:标签=@字符串/ APP_NAME>
        &所述;意图滤光器>
            <作用机器人:名字=totaltrainer.com.WorkoutPlace/>
        &所述; /意图滤光器>
    < /活性GT;
    <活动
        机器人:名字=。WorkoutHome
        机器人:标签=@字符串/ APP_NAME>
        &所述;意图滤光器>
            <作用机器人:名字=totaltrainer.com.WorkoutHome/>
        &所述; /意图滤光器>
    < /活性GT;
    <活动
        机器人:名字=。WorkoutGym
        机器人:标签=@字符串/ APP_NAME>
        &所述;意图滤光器>
            <作用机器人:名字=totaltrainer.com.WorkoutGym/>
        &所述; /意图滤光器>
    < /活性GT;
< /用途>< /清单>


解决方案

使用totaltrainer.com.WORKOUTGYM等
以下使用这种

 <类机器人:名字=android.intent.category.DEFAULT/>

Here's the problem guys, first i tried to run my application with Launch default activity as launch action (Run Configurations --> Android --> Launch action), the logcat kept telling me that it can't find the launcher activity and the application wouldn't even start, problem is i defined my launcher activity in the manifest file, but it's like it's not reading it at all.

So i tried to launch the splash activity by specifically telling it to run it through run configurations, it did launch but during the transition to the next activity it crashed again, the logcat says no activity found to handle intent, which again, I defined the way I did in other applications and worked alright there. Plase help it's a nightmare.

Here's the code for the MainActivity:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;


public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


Thread timer = new Thread()
{
    public void run(){
        try{
            sleep(6000);
        } catch (InterruptedException e){
             e.printStackTrace();
        } finally {
            Intent openStarting = new Intent("totaltrainer.com.WorkoutPlace");
            startActivity(openStarting);
        }
    }
};
timer.start();
}
@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}
}

And Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="totaltrainer.com"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="totaltrainer.com.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".WorkoutPlace"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="totaltrainer.com.WorkoutPlace" />
        </intent-filter>
    </activity>
    <activity
        android:name=".WorkoutHome"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="totaltrainer.com.WorkoutHome" />
        </intent-filter>
    </activity>
    <activity
        android:name=".WorkoutGym"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="totaltrainer.com.WorkoutGym" />
        </intent-filter>
    </activity>
</application>

</manifest>

解决方案

use "totaltrainer.com.WORKOUTGYM" and so on and below use this

<category android:name="android.intent.category.DEFAULT" />

这篇关于未找到可处理意图/不发射活动活动发现清单文件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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