启动画面工作正常。 但是应用程序停止了我该怎么办?
我尝试搜索,但效果不佳... 我对此事需要一些建议。
SplashScreenactivity.java
public class SplashScreenactivity extends AppCompatactivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EasySplashScreen config = new EasySplashScreen(SplashScreenactivity.this)
.withFullScreen()
.withTargetactivity(Mainactivity.class)
.withSplashTimeOut(5000)
.withBackgroundColor(Color.parseColor("#1a1b29"))
.withHeaderText("Header")
.withFooterText("Footer")
.withBeforeLogoText("Before LoGo Text")
.withAfterLogoText("After LoGo Text")
.withLogo(R.mipmap.ic_launcher_round);
config.getHeaderTextView().setTextColor(Color.WHITE);
config.getFooterTextView().setTextColor(Color.WHITE);
config.getBeforeLogoTextView().setTextColor(Color.WHITE);
config.getafterLogoTextView().setTextColor(Color.WHITE);
View easySplashScreen = config.create();
setContentView(easySplashScreen);
}
}
Mainactivity.java(仅上部)
public class Mainactivity extends AppCompatactivity
implements NavigationView.OnNavigationItemSelectedListener {
MenuItem menuSetting;
Toolbar toolbar;
DBHelper dbHelper;
AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsrtl="true"
android:theme="@style/Apptheme">
<activity
android:name=".SplashScreenactivity"
android:label="@string/app_name"
android:theme="@style/Apptheme.NoactionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Mainactivity"></activity>
</application>