For animations you can use
overridePendingTransition(0, 0); which I think is more reliable than the
Intent flag.
http://developer.android.com/reference/android/app/Activity.html#overridePendingTransition(int,
int)
Do it right before the startActivity
As for when to start the activity you might have luck creating a handler
and just posting a runnable to it in onCreate. I've done this in
transparent activities to avoid a brief black screen.
On Friday, February 1, 2013 8:08:27 AM UTC-6, Pent wrote:
>
> Progress! Don't know what I changed but managed to prevent the between
> startup and main activity animation. So a startup activity works, but
> only if there's a delay before
> I call the main activity. Here's the code:
>
> public class FrontDoor extends MyActivity {
>
> @Override
> public void onCreate( Bundle icicle ) {
>
> super.onCreate( icicle );
>
> MyFrameLayout v = new MyFrameLayout(this);
>
> v.setLayoutParams( new
> ViewGroup.LayoutParams( LayoutParams.FILL_PARENT,
> LayoutParams.FILL_PARENT ) );
> setContentView( v );
>
> v.setOnLayoutCallback( new MyFrameLayout.OnLayoutCallback() {
> @Override
> public void onLayout(int width, int height) {
> new Handler() {
> public void handleMessage( Message
> m ) {
> startActivity(
> new Intent(
> FrontDoor.this, Tasker.class ).
> setFlags(
> Intent.FLAG_ACTIVITY_NO_ANIMATION )
> );
> }
> }.sendEmptyMessageDelayed( 0, 500 );
> }
> });
> }
>
> (the theme-setting stuff is in MyActivity)
>
> If there's no delay, the startup activity disappears immediately and
> is not there while the main activity is loading. I put it in a layout
> handler because that's the latest hook I can find into the activity
> creation process so the time from there till the next activity is most
> constant.
>
> Anyone have a better hook where the activity has finished displaying
> and I can safely start the sub-activity ? onResume() and
> onPostResume() are not late enough.
>
> Pent
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.