how can come the main page after splash screen.

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how can come the main page after splash screen.

Postby pranav09 » Tue Jan 20, 2009 7:32 am

I have made splash screen and now i want to display my main screen after disappearing the splash screen. I have done coding for the splash screen.
JAVA FILE:

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

public class CardGame extends Activity {
/** Called when the activity is first created. */

private final int splash_length = 3000;

@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.main);

new Handler().postDelayed(new Runnable(){

public void run(){

try {} catch(Exception e){};

CardGame.this.finish();
}
}, splash_length);
}
}

XML FILE:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

>


<ImageView
android:id = "@+id/imgView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background = "@drawable/splash_screen"
/>

</LinearLayout>

Now what should i do? Tell me.

These are files are the part of my project. Help me as much as possible.
Thanks...
User avatar
pranav09
Senior Developer
Senior Developer
 
Posts: 128
Joined: Mon Jan 19, 2009 12:01 pm
Location: Ahmedabad, India

Top

Postby darolla » Tue Jan 20, 2009 11:43 am

I think there is a tutorial about splash screens ;)

simple_splash_screen-t811.html

greetings,
darolla
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests