为什么最初的空白活动在启动时显示? [英] Why does initial blank activity show on startup?
问题描述
在我的Android应用我有一个弹出一个对话框(用作闪屏)的初始活性。我这样做:
@覆盖
保护无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState); //弹出一个全屏对话框(用作飞溅)
showSplashScreen();
}
但是,现在这其中,一个空白的空与我的徽标和标题栏中显示前一个小的时间段。我不知道如何从显示在所有删除此。我甚至想看看,如果这是从相同的活动来了,我检查通过请求没有标题栏去掉标题栏。不过,我没有运气......这个神秘的空白活动显示了一个小的时间间隔。
如何像Facebook应用首先显示初始启动画面无其他操作之前呈现什么吗?
-
使用
的setContentView(R.layout.layout_name);
在code。 -
描述要打开在清单文件作为对话活动:
<活动
机器人:名字=。Description_Activity
机器人:screenOrientation =画像
机器人:主题=@安卓风格/ Theme.Dialog>
< /活性GT;
In my android app I have an initial activity which popup a dialog (used as the splash screen). I am doing this:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Popup a fullscreen dialog (used as splash)
showSplashScreen();
}
However there is a small time period before this where a blank empty with my logo and title bar show up. I have no idea how to remove this from showing at all. I even tried to see if this was coming from the same activity, I check by removing the title bar by requesting no title bar. However, I had no luck... This mysterious blank activity shows up for a small time interval.
How do apps like facebook show an initial splash screen first without showing anything else before?
use
setContentView(R.layout.layout_name);
in the code.Describe the Activity that you want to open as a dialogue in the manifest file as:
<activity android:name=".Description_Activity" android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog" > </activity>
这篇关于为什么最初的空白活动在启动时显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!