4

I strat an activity like so:

new Thread() {
    @Override
    public void run() {
        Intent i = new Intent();
        i.setClass(getBaseContext(), newPage.class);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        getBaseContext().startActivity(i);
    }
}.start();

and i use getActivity().overridePendingTransition(R.anim.slide_in_from_bottom, R.anim.nothing);

and in newPage.class i use overridePendingTransition(R.anim.nothing, R.anim.slide_out_to_bottom);

the animations are: slide_in_from_bottom.xml

<translate xmlns:android="http://schemas.android.com/apk/res/android"
           android:fromYDelta="100%p"
           android:toYDelta="0%p"
           android:duration="@android:integer/config_mediumAnimTime"/>

slide_out_to_bottom.xml

<translate xmlns:android="http://schemas.android.com/apk/res/android"
           android:fromYDelta="0%p"
           android:toYDelta="100%p"
           android:duration="@android:integer/config_mediumAnimTime"/>

nothing.xml

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="0" android:fromAlpha="1" android:toAlpha="1"/>

So what's worng?

when I finish newPage.class it looks great, but when I start newPage.class - the activity disappear (black screen) and only then the animation of the new activity starts [and i want to keep the first activity on the screen until the new one covers it]

** tried getWindow().setBackgroundDrawable(null);

and

ColorDrawable colorDrawable = new ColorDrawable( Color.TRANSPARENT );
getWindow().setBackgroundDrawable( colorDrawable );

but no luck...

Dan Methad
  • 217
  • 2
  • 6
  • 17

0 Answers0