Move onCreatePost to onCreate and eliminate functions

This commit is contained in:
Andrew Rabert 2018-04-23 22:58:54 -04:00
parent 8f0a27bfec
commit 7bb5b0f91d
1 changed files with 13 additions and 26 deletions

View File

@ -287,14 +287,21 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
return null;
}
}.execute());
}
@Override
protected void onPostCreate(Bundle bundle) {
super.onPostCreate(bundle);
if (!infoDialogDisplayed) {
infoDialogDisplayed = true;
if (Util.getRestUrl(this).contains("demo.subsonic.org")) {
Util.info(this, R.string.main_welcome_title, R.string.main_welcome_text);
}
}
showInfoDialog();
checkUpdates();
try {
String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
int ver = Integer.parseInt(version.replace(".", ""));
Updater updater = new Updater(ver);
updater.checkUpdates(this);
} catch (Exception ignored) {
}
}
@Override
@ -557,17 +564,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
}
}
private void checkUpdates() {
try {
String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
int ver = Integer.parseInt(version.replace(".", ""));
Updater updater = new Updater(ver);
updater.checkUpdates(this);
} catch (Exception ignored) {
}
}
private void loadSession() {
PreferenceManager.setDefaultValues(this, R.xml.settings_appearance, false);
PreferenceManager.setDefaultValues(this, R.xml.settings_cache, false);
@ -664,15 +660,6 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
}.execute();
}
private void showInfoDialog() {
if (!infoDialogDisplayed) {
infoDialogDisplayed = true;
if (Util.getRestUrl(this).contains("demo.subsonic.org")) {
Util.info(this, R.string.main_welcome_title, R.string.main_welcome_text);
}
}
}
@Override
public void onSongChanged(DownloadFile currentPlaying, int currentPlayingIndex) {
this.currentPlaying = currentPlaying;