Skip to content

Instantly share code, notes, and snippets.

@YvesBill
Created August 16, 2013 17:17
Show Gist options
  • Select an option

  • Save YvesBill/6251738 to your computer and use it in GitHub Desktop.

Select an option

Save YvesBill/6251738 to your computer and use it in GitHub Desktop.
...
public class Splash extends Activity {
private static final int STOPSPLASH = 0;
// Tempo impiegato dalla ImageView calcolato in millisecondi
private static final long SPLASHTIME = 3000;
private ImageView splash;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splash);
splash = (ImageView) findViewById(R.id.splash);
Message msg = new Message();
msg.what = STOPSPLASH;
splashHandler.sendMessageDelayed(msg, SPLASHTIME); }
private Handler splashHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
//L'unico case disponibile toglie la View alla immagine dopo un tot tempo
switch (msg.what) {
case STOPSPLASH:
splash.setVisibility(View.GONE);
break;
}
super.handleMessage(msg);
}
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment