RSS

Source code: The Splash screen

01 Jul

This is the full code for the splash screen. I will keep on adding stuff to it as I explain and also learn. So it isnt the complete thing.

package com.learning.gilo;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class Splash extends Activity{

	MediaPlayer song;

	protected void onCreate(Bundle b){
		super.onCreate(b);

		setContentView(R.layout.splash);

		song = MediaPlayer.create(Splash.this, R.raw.door); //the song is door.mp3
		song.start();

		Thread mythread = new Thread(){
			public void run(){
				try{
					sleep(2000);
				}catch(InterruptedException e){
					e.printStackTrace();
				}finally{
					Intent myIntent = new Intent("com.learning.gilo.MENULIST");
					startActivity(myIntent);
				}
			}

		};

		mythread.start();

	}

	protected void onPause(){
		super.onPause();
		song.release();
		finish();
	}
}

Advertisements
 
2 Comments

Posted by on July 1, 2012 in Source code

 

2 responses to “Source code: The Splash screen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: