Click here to Skip to main content
Sign Up to vote bad
good
See more: Android
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 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
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
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 3 Feb '13 - 3:50

Comments
analogx - 4 Feb '13 - 9:44
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:57
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 310
1 Slacker007 240
2 Mahesh Bailwal 230
3 Ron Beyer 215
4 Aarti Meswania 200
0 Sergey Alexandrovich Kryukov 8,598
1 OriginalGriff 7,024
2 CPallini 3,668
3 Rohan Leuva 3,011
4 Maciej Los 2,343


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid