I found that when I open the camera, navigate to another view and then I switch to another app and come back and try to open the camera the screen is all black. But if I open the camera view and then switch and come back the camera still works.
I'm not sure if this is a navigation issue, something regarding not unmounting the component when switching apps, or the plugin itself.
index.android.js
var React = require('react-native');
var Home = require('./app/android-components/home');
var CameraHandler = require('./app/android-components/camera_handler');
var helpers = require('./app/utils/helpers');
var {
AppRegistry,
StyleSheet,
BackAndroid,
Navigator
} = React;
var _navigator;
BackAndroid.addEventListener('hardwareBackPress', () => {
console.log("Pressing back");
if (_navigator.getCurrentRoutes().length === 1 ) {
return false;
}
_navigator.pop();
return true;
});
class MyApp extends React.Component {
_renderScene(route, navigator) {
_navigator = navigator;
switch (route.name) {
case 'Home':
return (
<View style={{flex:1}}>
<Home navigator={navigator} />
</View>
)
case 'Camera':
return (
<View style={{flex:1}}>
<CameraHandler navigator={navigator} helpers={helpers} />
</View>
)
}
}
render() {
return (
<Navigator
style={styles.container}
initialRoute={{
name : 'Home',
component : Home
}}
configureScene={() => Navigator.SceneConfigs.FadeAndroid}
renderScene={this._renderScene}
/>
)
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
},
});
AppRegistry.registerComponent('MyApp', () => MyApp);
Hey, first of all, thanks for doing this.
I found that when I open the camera, navigate to another view and then I switch to another app and come back and try to open the camera the screen is all black. But if I open the camera view and then switch and come back the camera still works.
I'm not sure if this is a navigation issue, something regarding not unmounting the component when switching apps, or the plugin itself.
index.android.js
home.js
camera_handler.js
Thanks! :)