Merge pull request #4239 from k9mail/fix_app_start

Fix app start and launcher activities after 'Accounts' activity removal
This commit is contained in:
cketti 2019-11-06 04:59:12 +01:00 committed by GitHub
commit a2d11393cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -84,12 +84,8 @@
<!-- TODO: Remove after 2020-12-31 -->
<activity-alias
android:name=".activity.Accounts"
android:targetActivity=".activity.MessageList" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
android:targetActivity=".activity.MessageList"
android:exported="true" />
<activity
android:name=".ui.onboarding.OnboardingActivity"

View file

@ -59,6 +59,7 @@ import com.fsck.k9.ui.R;
import com.fsck.k9.ui.Theme;
import com.fsck.k9.ui.messageview.MessageViewFragment;
import com.fsck.k9.ui.messageview.MessageViewFragment.MessageViewFragmentListener;
import com.fsck.k9.ui.onboarding.OnboardingActivity;
import com.fsck.k9.ui.settings.SettingsActivity;
import com.fsck.k9.view.ViewSwitcher;
import com.fsck.k9.view.ViewSwitcher.OnSwitchCompleteListener;
@ -208,6 +209,13 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
List<Account> accounts = preferences.getAccounts();
if (accounts.isEmpty()) {
OnboardingActivity.launch(this);
finish();
return;
}
if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {
finish();
return;