Android Manifest Splash Hello World完全启动
我有一个功能齐全的应用程序,如果你能调用一个全功能的hello world。 有3个标签,每个标签都做了一些事情,在它之前会出现一个飞溅 我想我犯了一个错误,试图使用谷歌api来获得一些gps的东西,并设法阻止了我的项目和备份版本。所以现在我只是想在我给我的讲师发邮件之前,把所有的内容重新整理一下 问题:当设置运行配置以启动启动启动时,启动完成后,我会收到大量错误。我是一个完全的新手,所以我不知道我的代码剩下的哪一部分是错误的。我怀疑是清单还是启动代码意图指针之类的东西 logcatAndroid Manifest Splash Hello World完全启动,android,splash-screen,Android,Splash Screen,我有一个功能齐全的应用程序,如果你能调用一个全功能的hello world。 有3个标签,每个标签都做了一些事情,在它之前会出现一个飞溅 我想我犯了一个错误,试图使用谷歌api来获得一些gps的东西,并设法阻止了我的项目和备份版本。所以现在我只是想在我给我的讲师发邮件之前,把所有的内容重新整理一下 问题:当设置运行配置以启动启动启动时,启动完成后,我会收到大量错误。我是一个完全的新手,所以我不知道我的代码剩下的哪一部分是错误的。我怀疑是清单还是启动代码意图指针之类的东西 logcat 10-24
10-24 05:28:08.297: D/dalvikvm(612): GC_EXTERNAL_ALLOC freed 673 objects / 52920 bytes in 136ms
10-24 05:28:13.185: W/dalvikvm(612): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
10-24 05:28:13.195: E/AndroidRuntime(612): FATAL EXCEPTION: Thread-8
10-24 05:28:13.195: E/AndroidRuntime(612): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.b00517566.helloworldfinal/com.b00517566.helloworld.HelloWorldfinalActivity}; have you declared this activity in your AndroidManifest.xml?
10-24 05:28:13.195: E/AndroidRuntime(612): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
10-24 05:28:13.195: E/AndroidRuntime(612): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
10-24 05:28:13.195: E/AndroidRuntime(612): at android.app.Activity.startActivityForResult(Activity.java:2817)
10-24 05:28:13.195: E/AndroidRuntime(612): at android.app.Activity.startActivity(Activity.java:2923)
10-24 05:28:13.195: E/AndroidRuntime(612): at com.b00517566.helloworldfinal.splash$1.run(splash.java:37)
显示
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.b00517566.helloworldfinal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".HelloWorldFinalActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="splash"> <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter></activity>
<activity android:name="ButtonTab">
<intent-filter></intent-filter>
</activity>
<activity android:name="MiscTab">
<intent-filter></intent-filter>
</activity>
<activity android:name="RadioBtnsTab">
<intent-filter></intent-filter>
</activity>
</application>
</manifest>
飞溅
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
// thread for displaying the SplashScreen
Thread splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
while(_active && (waited < _splashTime)) {
sleep(100);
if(_active) {
waited += 100;
}
}
} catch(InterruptedException e) {
// do nothing
} finally {
finish();
Intent i = new Intent();
i.setClassName("com.b00517566.helloworldfinal",
"com.b00517566.helloworld.HelloWorldfinalActivity");
startActivity(i);
//startActivity(new Intent("com528.b00517566.helloworld"));
// stop();
}
}
};
splashTread.start();
}
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
//用于显示屏幕的线程
螺纹飞溅踏板=新螺纹(){
@凌驾
公开募捐{
试一试{
int=0;
while(_active&&(waiting<_splashTime)){
睡眠(100);
如果(_活动){
平均值+=100;
}
}
}捕捉(中断异常e){
//无所事事
}最后{
完成();
意图i=新意图();
i、 setClassName(“com.b00517566.helloworldfinal”,
“com.b00517566.helloworld.HelloWorldfinalActivity”);
星触觉(i);
//startActivity(新意图(“com528.b00517566.helloworld”);
//停止();
}
}
};
splashTread.start();
}
错误表明它找不到“HelloWorldfinalActivity”,并且您的清单定义了“HelloWorldfinalActivity”-第一种情况下是小写的f,第二种情况下是大写的f
清单中的活动名称应与在活动前面加“.”的类名相同。例如,如果您有一个HelloWorldFinalActivity.class,那么清单中的名称应该是“.HelloWorldFinalActivity”
此外,还有一种更直接的方式开始活动:
Intent i = new Intent(CurrentActivityName.this, com.b00517566.helloworldfinal.HelloWorldFinalActivity.class)
startActivity(i);
用此代码所在的类的名称替换CurrentActivityName