Android应用程序将无法运行 [英] Android app will not run

查看:123
本文介绍了Android应用程序将无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图运行这个程序,我使用的了解线程和意图然而,应用程序将无法运行,但我没有任何警告/错误的code强调,任何人都可以帮我请

So I am trying to run this app I am using to learn about threads and intents however the app will not run, But I don't have any warning/error underlines in the code, could anyone help me please.

清单code:
    
    

Manifest code:

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.learn.tam.Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.SPLASH" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.learn.tam.StartingPoint"
        android:label="@string/app_name" >
    </activity>
 </application>

</manifest>

和活动code

package com.example.learn.tam;

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

public class Splash extends Activity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setContentView(R.layout.splash);

    Thread timer = new Thread(){

        public void run(){
            try {
                sleep(5000);
            }
            catch (InterruptedException e){
                e.printStackTrace();
            }
            finally{
Intent openStartingPoint = new   Intent("com.example.learn.tam.StartingPoint"); 
startActivity(openStartingPoint);
            }
        }
    };

    timer.start();
}



}

任何帮助将是AP preciated请

any help would be appreciated please

推荐答案

修改

<intent-filter>
            <action android:name="android.intent.action.SPLASH" />

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

<intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

由于很可能无法在主屏幕上显示您的应用程序(需要的类)。

,改变

Intent openStartingPoint = new   Intent("com.example.learn.tam.StartingPoint"); 
startActivity(openStartingPoint);

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

由于你的起点不与com.example.learn.tam.StartingPoint

看看是否能解决任何事情。

See if that fixes anything.

这篇关于Android应用程序将无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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