android.content.ActivityNotFoundException:无活动处理意向闪屏 [英] android.content.ActivityNotFoundException: No Activity found to handle Intent splash screen

查看:282
本文介绍了android.content.ActivityNotFoundException:无活动处理意向闪屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,装了我的启动画面后,一个新的意图。我看过有关此异常的问题,但他们似乎都被处理像谷歌的事情播放或谷歌地图不被正确引用,这是不适合我的情况。

I am having an issue with loading up a new intent after my splash screen. I have looked at questions relating to this exception but they all seem to be dealing with thing like google play or google maps not being referenced correctly this is not the case for me.

这些都是相关的问题我已经看过

These are the related questions I have looked at

没有找到活动来处理意图是什么?

活动没有找到处理的意图

没有找到处理的意图活动

下面是我的清单code

Below is my manifest code

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

    <uses-sdk android:minSdkVersion="15" />
    <uses-permission android:name="android.permission.INTERNET"/>

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".HomePage"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.HOMEPAGE" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".OrderPlaced"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.ORDERPLACED" />

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

</manifest>

下面是code该类飞溅

Here is the code for the class splash

package com.android.main;

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

public class Splash extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        Thread timer = new Thread(){
            public void run(){
                try{
                    sleep(1000);
                }catch(InterruptedException e) {
                    e.printStackTrace();
                }finally{
                    Intent openStartingPoint = new Intent("com.android.main.HOMEPAGE");
                    startActivity(openStartingPoint);
                }
            }
        };
        timer.start();
    }

    @Override
    protected void onPause() {

        super.onPause();
        finish();
    }


}

这里是一流的主页我试图启动画面后装入

And here is the class HomePage I am trying to load after the splash screen

package com.android.main;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

public class HomePage extends Activity {
    /** Called when the activity is first created. */


    TextView name;
    EditText editName;
    TextView drinks;
    Spinner drinksSpinner;
    TextView message;
    CheckBox checkbox;
    Button createOrderButton;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        createOrder();
    }

    public void createOrder(){

        createOrderButton = (Button) findViewById(R.id.bCreateOrder);
        createOrderButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                postInformationtoAPI();

            }

            private void postInformationtoAPI() {

                goToOrderCompleted();
            }

            private void goToOrderCompleted() {
                Intent intent = new Intent(HomePage.this , OrderPlaced.class);
                HomePage.this.startActivity(intent);
                Log.i("onClick", "trying to start new activity to change layout");
            }
        });

    }
}

该应用程序加载力的启动画面后退出,并给出以下异常

The app force quits after loading the splash screen and gives the following exception

03-14 22:32:33.553: E/AndroidRuntime(3166): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.main.HOMEPAGE }

任何帮助,这将大大pciated AP $ P $

Any help with this would be greatly appreciated

推荐答案

您必须区分意图的构造,

You have to differentiate the Intent's Constructor,

 Intent openStartingPoint = new Intent("com.android.main.HOMEPAGE");

即假定 com.android.main.HOMEPAGE 意图的行动过滤器。这是不是在你的应用程序的Andr​​oid manifest.xml文件可用。您有

Which assume com.android.main.HOMEPAGE as Intent's action Filter. Which is not available in your application's android manifest.xml file. You have

&lt;作用机器人:名称=android.intent.action.HOMEPAGE/&GT;

应该是,

&lt;作用机器人:名称=com.android.main.HOMEPAGE/&GT;

刚刚与改变,

Intent openStartingPoint = new Intent(Splash.this, HOMEPAGE.class);

这篇关于android.content.ActivityNotFoundException:无活动处理意向闪屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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