解决方案 »

  1.   

    this.overridePendingTransition(0, 0);
    使用了这种方法。
    关于闪屏问题:
    http://www.cppblog.com/fwxjj/archive/2013/01/14/197259.html 从这个博客看到的方法。
    第一步:自定义Theme(主题)在your_project/res/values/styles.xml中加入自定义Activity的Theme,如下所示:view plain   copy
    <?xml version="1.0" encoding="utf-8"?> 
    <resources> 
        <!-- Activity主题 --> 
        <style name="activityTheme" parent="@android:style/Theme"> 
            <item name="android:windowIsTranslucent">true</item> 
        </style> 
    </resources> 
    其中<item name="android:windowIsTranslucent">true</item>的意思是设置目标 Activity(要启动的那个Activity)是透明的。很容易理解,两个Activity,A和B;在A中启动B,因为B是透明的,看到的背景仍是 A,这样就解决了这个短暂的黑屏问题。第二步:修改Manifest,将Theme应用到目标Activity上定义好Theme后,就该为对应的Activity绑定Theme了。这个代码主要在Manifest中实现,在Activity中加上以下属性:view plain   copy
    <activity android:name=".activity.PlacingOrderStep1Activity"  
          android:theme="@style/activityTheme" />