Skip to content

Commit

Permalink
bug fix in xiaomi 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
XunMengWinter committed Jun 18, 2018
1 parent 0617df5 commit bafc1c1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions app/src/main/java/top/wefor/now/ui/activity/WelcomeActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package top.wefor.now.ui.activity;

import android.annotation.TargetApi;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.AppCompatImageView;
import android.text.TextUtils;
Expand Down Expand Up @@ -109,17 +106,14 @@ private int getWaitTime() {
return (int) waitTime;
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void go() {
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivityForResult(intent, Constants.WELCOME_ACTIVITY);
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
try {
if (this.getPackageManager().getPackageInfo(getPackageName(), 0).versionCode >= Build.VERSION_CODES.LOLLIPOP)
finishAfterTransition();
else finish();
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
if (NowAppUtil.isBelowLollipop()) {
finish();
} else {
finishAfterTransition();
}
}

Expand Down

0 comments on commit bafc1c1

Please sign in to comment.