Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2018-04-17 10:51:05 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2018-04-25 15:38:50 +0300
commit67bd4090a28439f4c2c58b1d0acc94ebc3bd786b (patch)
treea1f435c683b024b5dc1a60d22182d0d018845dc6 /android/src
parent7bbfa035c0fd1b52141e88b0579e6f6982afeba0 (diff)
[andoid] The method onCreate from BaseMwmFragmentActivity is finalized
Diffstat (limited to 'android/src')
-rw-r--r--android/src/com/mapswithme/maps/DownloadResourcesLegacyActivity.java4
-rw-r--r--android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java4
-rw-r--r--android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java13
-rw-r--r--android/src/com/mapswithme/maps/base/BaseToolbarActivity.java4
-rw-r--r--android/src/com/mapswithme/maps/editor/FeatureCategoryActivity.java7
-rw-r--r--android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java4
6 files changed, 19 insertions, 17 deletions
diff --git a/android/src/com/mapswithme/maps/DownloadResourcesLegacyActivity.java b/android/src/com/mapswithme/maps/DownloadResourcesLegacyActivity.java
index 9b37031332..13452114ba 100644
--- a/android/src/com/mapswithme/maps/DownloadResourcesLegacyActivity.java
+++ b/android/src/com/mapswithme/maps/DownloadResourcesLegacyActivity.java
@@ -218,9 +218,9 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
@CallSuper
@Override
- protected void onCreate(@Nullable Bundle savedInstanceState)
+ protected void safeOnCreate(@Nullable Bundle savedInstanceState)
{
- super.onCreate(savedInstanceState);
+ super.safeOnCreate(savedInstanceState);
setContentView(R.layout.activity_download_resources);
initViewsAndListeners();
diff --git a/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java b/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java
index 21e92a7c2e..d1ebe7d5fc 100644
--- a/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java
+++ b/android/src/com/mapswithme/maps/base/BaseMwmExtraTitleActivity.java
@@ -13,9 +13,9 @@ public class BaseMwmExtraTitleActivity extends BaseMwmFragmentActivity
@Override
@CallSuper
- protected void onCreate(Bundle savedInstanceState)
+ protected void safeOnCreate(Bundle savedInstanceState)
{
- super.onCreate(savedInstanceState);
+ super.safeOnCreate(savedInstanceState);
String title = "";
Bundle bundle = getIntent().getExtras();
diff --git a/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java b/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java
index a4670955f2..3eff1b013d 100644
--- a/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java
+++ b/android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java
@@ -14,7 +14,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
-import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.SplashActivity;
@@ -50,9 +49,15 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
}
+ /**
+ * Shows splash screen and initializes the core in case when it was not initialized.
+ *
+ * Do not override this method!
+ * Use {@link #safeOnCreate(Bundle savedInstanceState)}
+ */
@CallSuper
@Override
- protected void onCreate(@Nullable Bundle savedInstanceState)
+ protected final void onCreate(@Nullable Bundle savedInstanceState)
{
if (!MwmApplication.get().arePlatformAndCoreInitialized()
|| !PermissionsUtils.isExternalStorageGranted())
@@ -69,6 +74,10 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
safeOnCreate(savedInstanceState);
}
+ /**
+ * Use this safe method instead of {@link #onCreate(Bundle savedInstanceState)}.
+ * When this method is called, the core is already initialized.
+ */
@CallSuper
protected void safeOnCreate(@Nullable Bundle savedInstanceState)
{
diff --git a/android/src/com/mapswithme/maps/base/BaseToolbarActivity.java b/android/src/com/mapswithme/maps/base/BaseToolbarActivity.java
index 58157b8e8c..1e6004cc43 100644
--- a/android/src/com/mapswithme/maps/base/BaseToolbarActivity.java
+++ b/android/src/com/mapswithme/maps/base/BaseToolbarActivity.java
@@ -14,9 +14,9 @@ public abstract class BaseToolbarActivity extends BaseMwmFragmentActivity
{
@CallSuper
@Override
- protected void onCreate(@Nullable Bundle savedInstanceState)
+ protected void safeOnCreate(@Nullable Bundle savedInstanceState)
{
- super.onCreate(savedInstanceState);
+ super.safeOnCreate(savedInstanceState);
Toolbar toolbar = getToolbar();
if (toolbar != null)
diff --git a/android/src/com/mapswithme/maps/editor/FeatureCategoryActivity.java b/android/src/com/mapswithme/maps/editor/FeatureCategoryActivity.java
index f4fd72a3f8..eee4f4dddd 100644
--- a/android/src/com/mapswithme/maps/editor/FeatureCategoryActivity.java
+++ b/android/src/com/mapswithme/maps/editor/FeatureCategoryActivity.java
@@ -1,7 +1,6 @@
package com.mapswithme.maps.editor;
import android.content.Intent;
-import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
@@ -12,12 +11,6 @@ public class FeatureCategoryActivity extends BaseMwmFragmentActivity implements
public static final String EXTRA_FEATURE_CATEGORY = "FeatureCategory";
@Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- }
-
- @Override
protected Class<? extends Fragment> getFragmentClass()
{
return FeatureCategoryFragment.class;
diff --git a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
index 94cc5e6741..8bd43ad81d 100644
--- a/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
+++ b/android/src/com/mapswithme/maps/gallery/FullScreenGalleryActivity.java
@@ -55,12 +55,12 @@ public class FullScreenGalleryActivity extends BaseMwmFragmentActivity
}
@Override
- protected void onCreate(Bundle savedInstanceState)
+ protected void safeOnCreate(Bundle savedInstanceState)
{
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
- super.onCreate(savedInstanceState);
+ super.safeOnCreate(savedInstanceState);
Toolbar toolbar = getToolbar();
toolbar.setTitle("");
UiUtils.showHomeUpButton(toolbar);