react-native-android

React native — call phone number with extension

蓝咒 提交于 2019-12-20 11:53:00
问题 I am trying to open phone number with extension. Linking works with just phone number Tried with few options Linking.openURL('tel:XXXXXXXXX,XXX'); Linking.openURL('tel:'+ encodeURIComponent('XXXXXXXXX,XXX')); Dialer only dials primary number and doesnt include extension I could write a native code and expose the method, but that would be my last option 回答1: I know it is late, but you can try this component: react-native-communications. It works well both on iOS and Android. You have to import

Call Android activity from React-Native code

元气小坏坏 提交于 2019-12-20 10:34:49
问题 I am using REACT-NATIVE to build android app. I want to call android activity from React-Native code. (say when I clicked the button in my react native code, it should call android activity) I have 4 class files MainActivity.java (created by react-native when opened in android studio) MainApplication.java (created by react-native) Login.java (android activity file) Example.java (android activity file) Want to achieve following flow: Login.java -> React-Native js -> Example.java I already went

How to disable landscape mode in React Native Android dev mode?

落爺英雄遲暮 提交于 2019-12-20 09:09:41
问题 I am new to android environment. I know iOS can be done in Xcode to disable device orientation. How can I disable landscape mode or any orientation mode in React Native Android? Thanks. 回答1: Add android:screenOrientation="portrait" to the activity section in android/app/src/main/AndroidManifest.xml file, so that it end up looking like this: <activity android:name=".Activity" android:label="Activity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation

React Native Navigation Passing back parameters two screen pop

隐身守侯 提交于 2019-12-20 06:07:29
问题 I have a Screen for Main then it's push to Next for selection and passes parameters to next pushed screen and when you select something in that screen I need to pop(2) and send selected details to the main screen. But pop didn't accept parameters. How to accomplish this. I don't use Redux or MobX. 回答1: You need to do this Screen A: this.props.navigation.navigate('ScreenB', { onPressScreenAFun: (params) => { this.screenAFun(params) }, }) screenAFun = (params) => { console.log(params) } Screen

React Native Navigation Passing back parameters two screen pop

﹥>﹥吖頭↗ 提交于 2019-12-20 06:06:07
问题 I have a Screen for Main then it's push to Next for selection and passes parameters to next pushed screen and when you select something in that screen I need to pop(2) and send selected details to the main screen. But pop didn't accept parameters. How to accomplish this. I don't use Redux or MobX. 回答1: You need to do this Screen A: this.props.navigation.navigate('ScreenB', { onPressScreenAFun: (params) => { this.screenAFun(params) }, }) screenAFun = (params) => { console.log(params) } Screen

React Native - Disable “Screen Size” Setting

大城市里の小女人 提交于 2019-12-19 19:58:37
问题 I am currently developing a React Native application, and some of our users might have slight vision problems. We wish to prevent the setting "Display Size" in Android, as this makes our app unusable. We solved the problem with the Font Size using the simple line: Text.defaultProps.allowFontScaling=false; Is there a similar solution to the Display Size setting? Thanks in advance 回答1: You can control using flex property in view. Use to below to the parent view and adjust the flex value from 0

Empty text space in a continuous Text component react-native

空扰寡人 提交于 2019-12-19 09:46:55
问题 I have this problem: I need to put the word "dummy" in the first line until the line was complete. You can see the sample here: https://snack.expo.io/B1KcRgGWX The code: import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; import { Constants } from 'expo'; export default class App extends Component { render() { return ( <View style={styles.container}> <View style={styles.paragraphs}> <Text style={styles.textParagraph}>Lorem Ipsum is</Text> <Text

React Native reload page

我的未来我决定 提交于 2019-12-19 08:56:57
问题 So I have an app with an activity. The app checks for Internet connection at the beginning. If there are no Internet connection, it will show a screen with a button to refresh the page. The problem is that my API calls (Axios) is located on componentDidMount() where it's called only once after the first render. Is there any way I can reload the page so it calls componentDidMount again? I mean like total refresh. I am using EXPO btw. Any help is appreciated. Sorry there are no examples, I just

Facing issue “ Failed to install the app. Make sure you have the Android development environment ” in react native

本秂侑毒 提交于 2019-12-19 06:56:37
问题 Would you please help me, I am stuck to create a new project in react-native Like below screenshot. I have able to run old projects. but I am not able to run a new project I have followed these steps: react-native init projectName cd projectName react-native run-projectName But I get the error below: error Failed to install the app. Make sure you have the Android development environment set up: 回答1: To make sure your environment is setup properly for android, go to the root of your react

Facing issue “ Failed to install the app. Make sure you have the Android development environment ” in react native

时光怂恿深爱的人放手 提交于 2019-12-19 06:56:11
问题 Would you please help me, I am stuck to create a new project in react-native Like below screenshot. I have able to run old projects. but I am not able to run a new project I have followed these steps: react-native init projectName cd projectName react-native run-projectName But I get the error below: error Failed to install the app. Make sure you have the Android development environment set up: 回答1: To make sure your environment is setup properly for android, go to the root of your react