Я пытался добавить заставок в мое приложение, и в то время как они показывают перед основной деятельности, на этом экране также всегда показывает, независимо от того, что:Как избавиться от экрана заставки по умолчанию?
Вот код для 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