Advertisement
Guest User

Tutorial 1.8

a guest
Feb 15th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.34 KB | None | 0 0
  1. AndroidManifest.xml
  2.  
  3. <?xml version="1.0" encoding="utf-8"?>
  4. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  5.     package="com.caius.thebasics"
  6.     android:versionCode="1"
  7.     android:versionName="1.0" >
  8.  
  9.     <uses-sdk
  10.         android:minSdkVersion="14"
  11.         android:targetSdkVersion="17" />
  12.  
  13.     <application
  14.         android:allowBackup="true"
  15.         android:icon="@drawable/ic_launcher"
  16.         android:label="@string/app_name"
  17.         android:theme="@style/AppTheme" >
  18.        
  19.         <activity
  20.             android:name="com.caius.thebasics.Menu"
  21.             android:label="@string/app_name" >
  22.             <intent-filter>
  23.                 <action android:name="com.caius.thebasics.MENU" />
  24.                 <category android:name="android.intent.category.DEFAULT" />
  25.             </intent-filter>
  26.         </activity>
  27.        
  28.         <activity
  29.             android:name="com.caius.thebasics.Main"
  30.             android:label="@string/app_name" >
  31.             <intent-filter>
  32.                 <action android:name="android.intent.action.MAIN" />
  33.                 <category android:name="android.intent.category.LAUNCHER" />
  34.             </intent-filter>
  35.         </activity>
  36.        
  37.  
  38.     </application>
  39.  
  40. </manifest>
  41.  
  42.  
  43.  
  44.  
  45.  
  46. Main.java
  47.  
  48. package com.caius.thebasics;
  49.  
  50. import android.app.Activity;
  51. import android.content.Intent;
  52. import android.os.Bundle;
  53. import android.view.Menu;
  54.  
  55. public class Main extends Activity {
  56.  
  57.     @Override
  58.     protected void onCreate(Bundle savedInstanceState) {
  59.         super.onCreate(savedInstanceState);
  60.         setContentView(R.layout.activity_splash);
  61.         Thread logoTimer = new Thread(){
  62.             public void run(){
  63.                 try{
  64.                     Thread.sleep(2000);
  65.                     Intent menuIntent = new Intent("com.caius.thebasics.MENU");
  66.                     startActivity(menuIntent);
  67.                 }
  68.             catch (InterruptedException e) {
  69.                     // TODO Auto-generated catch block
  70.                     e.printStackTrace();
  71.             }
  72.                
  73.                 finally{
  74.                     finish();
  75.                 }
  76.             }
  77.         };
  78.         logoTimer.start();
  79.     }
  80.    
  81.  
  82.  
  83.     @Override
  84.     public boolean onCreateOptionsMenu(Menu menu) {
  85.         // Inflate the menu; this adds items to the action bar if it is present.
  86.         getMenuInflater().inflate(R.menu.main, menu);
  87.         return true;
  88.     }
  89.    
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement