[mono-android] Splash Page on Resume

Atsushi Eno atsushieno at veritas-vos-liberabit.com
Sat Dec 22 20:10:33 UTC 2012


Hello,

For exactly the same reason you are stuck, I prefer this approach for 
splash screen:

--------
public class MySpashScreenActivity extends Activity {

     private TimerTask task;

     protected void onCreate (Bundle bundle)
     {
         super.onCreate (bundle);
         ImageView iv = new ImageView (this);
         iv.setImageResource (R.drawable.mysplashdrawing);
         ViewGroup.LayoutParams ivparams = new ViewGroup.LayoutParams 
(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
         setContentView (iv);

         task = new TimerTask () {
             @Override
             public void run ()
             {
                 finish ();
                 Intent intent = new Intent (MySpashScreenActivity.this, 
ActualMainLauncher.class);
                 intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK);
                 startActivity (intent);
             }
         };
         new Timer ().schedule (task, 2000);
     }
}
--------

Atsushi Eno

craig wrote:
> I saw this tutorial on splash pages:
>
> http://docs.xamarin.com/Android/Guides/User_Interface/Creating_a_Splash_Screen
>
> However, boss wants the app to reload data from server and re-display splash
> page whenever app is resumed from background, which could be in the middle
> of the app instead of at the very beginning.  Is there a good strategy for
> doing this?
>
> I've tried a couple different ways but all have flaws.  Thanks for your
> help.
>
>
>
> --
> View this message in context: http://mono-for-android.1047100.n5.nabble.com/Splash-Page-on-Resume-tp5712633.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
>



More information about the Monodroid mailing list