• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps What's wrong with my code?

bckc

Lurker
Aug 4, 2013
1
0
Hi guys,

Can someone please tell me what I've done wrong here?:

Manifest snippet:
Code:
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.bradley.appname.Splash" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
      <activity
            android:name=".mainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.bradley.appname.MainActivity" />

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

My java snippet:
Code:
        Thread timer = new Thread(){
            
            public void run(){
                
                try{
                    sleep(4000);        
                }catch(InterruptedException e){
                    e.printStackTrace();
                }finally{
                    Intent openMain = new Intent("com.bradley.appname.MainActivity");

                    startActivity(openMain);
                }
                
            }
        };
        timer.start();

When the splashscreen starts it waits 4 seconds then says "app name has been forced to close"

Bckc
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones