Click here to Skip to main content
15,881,623 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
1. Well , i am very new to android development.
2. I do have basic knowledge about xml and java
3. Problem: My app is supposed to splash the welcome screen and then load the login page. But it just splashes a blank screen for a second.
4. I don't understand why is the code failing.Any kind of help/inputs/pointers are greatly appreciated

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

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".WelcomeActivity"
            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=".Login" >
        </activity>
    
    </application>
    
</manifest>



2.WelcomeActivity.java
Java
package com.example.wi_fi_canic;

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

public class WelcomeActivity extends Activity {
    final int display = 3000;
    //private int count = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);

        new Handler().postDelayed(new Runnable(){
            @Override
            public void run() {
                Intent i = new Intent(WelcomeActivity.this,Login.class);
                WelcomeActivity.this.startActivity(i);
                WelcomeActivity.this.finish();
            }
        }, display);

    }
    /*@Override
     public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_welcome, menu);
        return true;
    }*/

}


3.Login.java
Java
import android.app.Activity;
import android.os.Bundle;

public class Login extends Activity{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);

    }
}
Posted
Comments
analogx 4-Feb-13 9:44am    
What have tried to debug,one solution is to put toast in onCreate() method to check whether it is going in it or not...after that you can narrow down the search.Also what is your logcat saying about the application crash it must be giving some kind of error info about it.
harsha_n 4-Feb-13 21:57pm    
Analogx,firstly Thank you. I have introduced a Toast statement in OnCreate() , the control doesn't go into the program. LogCat is throwing me the errors in an infinite fashion. I mean its not just few errors , there seems to be thousands of errors.

The code is here : http://www.mediafire.com/?9qn8jy7y3wgj9g1



This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900