From 4e952dd87ac131bb13ed0662cd04980347c84fe3 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Sat, 24 Sep 2016 16:03:41 -0400 Subject: [PATCH] Remove MainActivity and use activity-alias --- app/src/main/AndroidManifest.xml | 30 +++++++++++----- .../java/org/isoron/uhabits/MainActivity.java | 34 ------------------- .../uhabits/activities/BaseActivity.java | 3 +- 3 files changed, 23 insertions(+), 44 deletions(-) delete mode 100644 app/src/main/java/org/isoron/uhabits/MainActivity.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index eb23b5e60..771c5fff2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -50,22 +50,28 @@ android:value="AEdPqrEAAAAI6aeWncbnMNo8E5GWeZ44dlc5cQ7tCROwFhOtiw"/> + + + android:launchMode="singleTop" + android:targetActivity=".activities.habits.list.ListHabitsActivity"> - - + + android:value=".activities.habits.list.ListHabitsActivity"/> + android:value=".activities.habits.list.ListHabitsActivity"/> + android:value=".activities.habits.list.ListHabitsActivity"/> - + - + - + diff --git a/app/src/main/java/org/isoron/uhabits/MainActivity.java b/app/src/main/java/org/isoron/uhabits/MainActivity.java deleted file mode 100644 index 57dc9cbdd..000000000 --- a/app/src/main/java/org/isoron/uhabits/MainActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2016 Álinson Santos Xavier - * - * This file is part of Loop Habit Tracker. - * - * Loop Habit Tracker is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or (at your - * option) any later version. - * - * Loop Habit Tracker is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -package org.isoron.uhabits; - -import org.isoron.uhabits.activities.habits.list.ListHabitsActivity; - -/** - * Application that starts upon clicking the launcher icon. - */ -public class MainActivity extends ListHabitsActivity -{ - /* - * Since changing the main activity on the manifest file causes things to - * break we always point the launcher icon to this activity instead, and - * redirect to the desired one using inheritance. - */ -} diff --git a/app/src/main/java/org/isoron/uhabits/activities/BaseActivity.java b/app/src/main/java/org/isoron/uhabits/activities/BaseActivity.java index 062b0927a..65b2f8682 100644 --- a/app/src/main/java/org/isoron/uhabits/activities/BaseActivity.java +++ b/app/src/main/java/org/isoron/uhabits/activities/BaseActivity.java @@ -26,6 +26,7 @@ import android.support.v7.app.*; import android.view.*; import org.isoron.uhabits.*; +import org.isoron.uhabits.activities.habits.list.*; import static android.R.anim.*; @@ -80,7 +81,7 @@ abstract public class BaseActivity extends AppCompatActivity public void restartWithFade() { new Handler().postDelayed(() -> { - Intent intent = new Intent(this, MainActivity.class); + Intent intent = new Intent(this, ListHabitsActivity.class); finish(); overridePendingTransition(fade_in, fade_out); startActivity(intent);