我已經嘗試添加閃屏到我的應用程序,而他們這樣做的主要活動前表示,該屏幕還總是顯示不管是什麼:如何擺脫這個默認的啓動畫面?
這裏是MainActivity代碼:
public class MainActivity extends Activity implements WelcomeFragment.StartQuestions, QuestionFragment.QuestionsAnswered {
@Override
protected void onCreate(Bundle savedInstanceState) {
Parse.enableLocalDatastore(this);
Parse.initialize(this, "***************************", "*****************************");
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
loadingIcon = (ProgressBar) findViewById(R.id.loadingIcon);
loadingIcon.setVisibility(View.GONE);
checkInternetConnection();
showWelcomeScreen();
}
}
showWelcomeScreen():
public void showWelcomeScreen(){
Fragment fragment = getFragmentManager().findFragmentById(R.id.fragmentContainer);
if (fragment == null){
fragment = new WelcomeFragment();
getFragmentManager().beginTransaction()
.add(R.id.fragmentContainer, fragment)
.commit();
} else {
fragment = new WelcomeFragment();
getFragmentManager().beginTransaction()
.replace(R.id.fragmentContainer, fragment)
.commit();
}
}
activity_main.xml中:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" android:id="@+id/loadingIcon"/>
</RelativeLayout>
在MainActivity,我已經指定去除頂部條: this.requestWindowFeature(Window.FEATURE_NO_TITLE);
軟件本身不具備吧。在啓動應用程序時,我將任何作爲默認設置放置在清單中的活動(充當啓動屏幕)仍然通過上面顯示的屏幕進行。
發佈您的主要活動代碼。 –
您需要爲您的問題添加相關代碼才能幫助您 – PPartisan
抱歉。我認爲這是一個每個人都得到的默認屏幕,不管他們的活動代碼 – dbalagula23