將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>
本文出自 Ray-Ray的博客
文章地址 http://www.cnblogs.com/rayray/archive/2013/03/03/2939060.html
感謝大家的推薦和收藏