Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 4:50am
Comments
analogx at 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 at 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)

  Print Answers RSS
0 DamithSL 370
1 Maciej Los 217
2 OriginalGriff 213
3 BillWoodruff 135
4 Zoltán Zörgő 85
0 OriginalGriff 7,953
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,454
3 Maciej Los 5,293
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100