Wednesday, April 3, 2013

Not showing Main Activity after Splash screen


I under stand the thousand of people saying "don't use a splash," I get it, but the app is not that big, I just want to know what I am doing wrong I think it is something with my Manifest but after my splash shows and when its supposed to go to main page, I get error "Sorry! The Application Grifball (process com.grifball.info) has stopped unexpectedly. Please try again.


Here is my Manifest.




package="com.grifball.info"
android:versionCode="1"
android:versionName="1.0" >

android:minSdkVersion="8"
android:targetSdkVersion="8" />

android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >








android:name="MainActivity"
android:label="@string/app_name" >












Here is my Splash's Java



package com.grifball.info;

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

public class Splash extends Activity{

@Override
protected void onCreate(Bundle startup) {
// TODO Auto-generated method stub
super.onCreate(startup);
setContentView(R.layout.splash);

Thread timer = new Thread(){

public void run(){

try{
sleep(5000);
}catch(InterruptedException e){
e.printStackTrace();
}finally{
Intent openMainActivity = new Intent("com.grifball.info.MAINACTIVITY");
startActivity(openMainActivity);
}
}

};
timer.start();
}

}


Here is the XML




android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/splashbg">





.

forums.androidcentral.com

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...