Files
mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java
Miguel Alatzar cbe0c719ac [MM-15874] Add native code to support RNN v2 on Android (#2855)
* Remove fix for MM-9233

* MM-15774 Add native code to support RNN v2 on iOS

* Android changes for RNN v2 upgrade

The activity visibility handling of NotificationsLifecycleFacade
is no longer needed in RNN v2. I've moved the lifecycle callbacks
we use for handling managed config into
ManagedActivityLifecycleCallbacks.java and registered them in
MainApplication's onCreate. Also, I've moved and updated the
loading and getting of the managed config into MainApplication

* Update moduleNames and modulePaths

* Use TAG in restrictionsReceiver

* Set launch screen onCreate

* Comment out registerActivityLifecycleCallbacks for now

* Remove setSoftInputMode call as it's handled in the manifest

* Remove clearHostOnActivityDestroy as that fix is no longer needed

* Rename to canLaunchEntry

* Remove replacement of super.onBackPressed()

* Remove react-navigation from packager files
2019-06-12 15:26:03 -04:00

29 lines
891 B
Java

package com.mattermost.rnbeta;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.reactnativenavigation.NavigationActivity;
public class MainActivity extends NavigationActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.launch_screen);
/**
* Reference: https://stackoverflow.com/questions/7944338/resume-last-activity-when-launcher-icon-is-clicked
* 1. Open app from launcher/appDrawer
* 2. Go home
* 3. Send notification and open
* 4. It creates a new Activity and Destroys the old
* 5. Causing an unnecessary app restart
* 6. This solution short-circuits the restart
*/
if (!isTaskRoot()) {
finish();
return;
}
}
}