现在的位置: 首页 > 综合 > 正文

Android android:launchMode=“singleInstance” 页面跳转黑屏

2018年02月16日 ⁄ 综合 ⁄ 共 578字 ⁄ 字号 评论关闭

将Activity的启动模式设置为singleInstance,即android:launchMode=“singleInstance” 

当应用跳转到启动模式设置为singleInstance的Activity页面时,出现一段黑屏

修改方式如下

步骤一、在AndroidManifest.xml中设置Activity主题 android:theme="@style/Theme.TitleBar"

<activity
            android:name="ActivityDemo"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.TitleBar" >
 </activity>

步骤二、在\res\values\styles.xml 中添加

<style name="Theme.TitleBar" parent="android:Theme.Light" />

    <style name="Theme.TitleBar" parent="android:Theme">
        <item name="android:windowIsTranslucent">true</item>
    </style>

文章地址 http://www.cnblogs.com/rayray/archive/2013/03/03/2939060.html

抱歉!评论已关闭.