forked from Ivasoft/mattermost-mobile
* 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
29 lines
891 B
Java
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;
|
|
}
|
|
}
|
|
}
|