Simple splash screen - Alternative

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Re: Simple splash screen - Alternative

Postby onlineadr » Wed May 04, 2011 4:12 am

la3bna you will need to tell the splash screen what you want it to do, at the moment i want the app to show the splash screeen once and never show it again till you force close it...

should be easy (i'm just lazy)

you need to tell the splash screen class what you want it to do....
onlineadr
Experienced Developer
Experienced Developer
 
Posts: 59
Joined: Thu Apr 28, 2011 12:45 pm

Top

Re: Simple splash screen - Alternative

Postby la3bna » Wed May 04, 2011 5:50 am

@onlineadr:

This is my code for the activity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class Splash extends Activity {
  2.  private final int SPLASH_DISPLAY_LENGHT = 1500;
  3.         @Override
  4.         public void onCreate(Bundle icicle) {
  5.                 super.onCreate(icicle);
  6.             setContentView(R.layout.splash);
  7.             new Handler().postDelayed(new Runnable(){
  8.  
  9.                 public void run() {
  10.                  Intent mainIntent = new Intent(Splash.this,NSFTabWidget.class);
  11.                  Splash.this.startActivity(mainIntent);
  12.                  Splash.this.finish();
  13.  
  14.                         }
  15.  
  16.                 }, SPLASH_DISPLAY_LENGHT);
  17.  
  18.         }
  19.  
  20. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

I have also this in my Manifest with the splash as first activity then my second :

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <activity android:name=".Splash">
  2.                  <intent-filter>
  3.                         <action android:name="android.intent.action.MAIN" />
  4.                 <category android:name="android.intent.category.LAUNCHER" />      
  5.             </intent-filter>
  6.         </activity>
  7.         <activity android:name=".NSFTabWidget"
  8.                 android:label="@string/app_name"
  9.                 android:theme="@android:style/Theme.NoTitleBar">
  10.             <intent-filter>
  11.                 <action android:name="android.intent.action.DEFAULT" />
  12.                 <category android:name="android.intent.category.VIEW" />
  13.             </intent-filter>
  14.         </activity>
  15.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4

I thought this was correct. At least from what plusminus has in the first thread
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Simple splash screen - Alternative

Postby onlineadr » Wed May 04, 2011 7:08 am

ok according to your code you need to add "@Override" above "public void run() {"

other than that i dont see any issues... (i'm not at home atm so i cant compare with my code)
onlineadr
Experienced Developer
Experienced Developer
 
Posts: 59
Joined: Thu Apr 28, 2011 12:45 pm

Re: Simple splash screen - Alternative

Postby la3bna » Wed May 04, 2011 10:17 am

Ok
That didnt really help me. Does the API level on the app have anything to do with it?

The app is made with sdk min API 7

I get the splash screen on AVD (API 8) but not on my Desire HD
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Re: Simple splash screen - Alternative

Postby onlineadr » Thu May 05, 2011 2:42 am

hmmm..... i ran mine on the avd and my Desire and it works fine... i have set mine to min API 8
onlineadr
Experienced Developer
Experienced Developer
 
Posts: 59
Joined: Thu Apr 28, 2011 12:45 pm

Re: Simple splash screen - Alternative

Postby la3bna » Thu May 05, 2011 5:39 am

Could it be that I have at least one process from the app working in the background?
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Top

Re: Simple splash screen - Alternative

Postby la3bna » Thu May 05, 2011 1:20 pm

Do a complete reinst of app solved my issue ?!?!?
la3bna
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Wed Mar 30, 2011 5:49 am
Location: Stavern, Norway

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests