当我使用应用程序选择器并转到另一个应用程序并返回到我的工作正常。 这是我的App组件
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View
} from 'react-native';
import { observable, action } from 'mobx';
import { observer } from 'mobx-react'
import { SplashScreen } from './screeens/SplashScreen';
import { DashboardScreen } from './screeens/DashboardScreen';
import { AppNavigator, AppNavigatorNoAuth } from './routes';
@observer
export default class App extends React.Component {
@observable isInitialized = false;
@observable isFontInitialized = false;
@observable isLoggedIn = false;
@action
initializeApp = async () => {
setTimeout(() => {
this.isInitialized = true;
}, 3500)
}
componentDidMount = () => {
this.initializeApp();
};
render() {
if (!this.isInitialized) {
return <SplashScreen />
} else if (!this.isLoggedIn) {
return <AppNavigatorNoAuth />
} else {
return <AppNavigator />
}
}
}
答案 0 :(得分:3)
经过一些调查,在本地回购https://github.com/facebook/react-native/issues/7079中得到了这个错误报告
我尝试了来自&#34; rreusser&#34;的解决方案。它起作用了。
我在manifest.xml上的主要活动声明中添加了android:launchMode="singleTask"