overridePendingTransition不起作用 [英] overridePendingTransition doesn't work

查看:1628
本文介绍了overridePendingTransition不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经找到了一些人问同样的,但解决方案并没有为我工作。

Have found already some people asking the same, but the solutions didn't work for me.

我看不到动画。

调用这种方式:

Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);

fadein.xml和fadeout.xml都在动画文件夹:

fadein.xml and fadeout.xml are in the anim folder:

fadein.xml:

fadein.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <alpha
        android:duration="1000"
        android:fromAlpha="0.0"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toAlpha="1.0" />
</set>

fadeout.xml:

fadeout.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

  <alpha
      android:duration="1000"
      android:fromAlpha="1.0"
      android:interpolator="@android:anim/accelerate_interpolator"
      android:toAlpha="0.0" />

</set>

使用分钟。 API 7:

Using min. API 7:

清单:

<uses-sdk android:minSdkVersion="7"/>

API 7也是我的project.properties文件:

API 7 is also in my project.properties file:

target=android-7

我在做什么错了?

What am I doing wrong?

Pd积。删除与插线不会改变任何东西。

P.D. Removing the lines with the interpolator doesn't change anything.

已经看到/尝试:

<一个href=\"http://stackoverflow.com/questions/11364714/overridependingtransition-doesnt-work\">overridePendingTransition不工作

<一个href=\"http://stackoverflow.com/questions/4633543/overridependingtransition-does-not-work-when-flag-activity-reorder-to-front-is-u\">overridePendingTransition当flag_activity_reorder_to_front使用不起作用

<一个href=\"http://stackoverflow.com/questions/9150054/fade-in-activity-from-$p$pvious-activity-in-android\">Fade在针对Android previous活动活动

<一个href=\"http://stackoverflow.com/questions/9150054/fade-in-activity-from-$p$pvious-activity-in-android\">Fade在针对Android previous活动活动

Android中活动转移

推荐答案

的问题是,该装置,至少在三星Galaxy的情况下,必须有这使工作动画。这可以在设置菜单来完成。

The problem was that the device, at least in the case of Samsung Galaxy, has to have animations enabled for this to work. This can be done in the settings menu.

这篇关于overridePendingTransition不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆