问题
I'm trying to link with android os settings page.
Going to Phone Dail with Linking is work.
Linking.openURL('tel: +959 XXXXXXXX');
Can I use Linking to link with android os settings page like android location settings page?
回答1:
Linking.openURL can only open correctly formatted urls. There are no standardized urls for the android settings. You would have to write some native code to do this, and then build a React Native Module to trigger it.
Here is some example Android code:
public void openWifiSettings() {
Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
来源:https://stackoverflow.com/questions/38893684/linking-with-android-os-settings-in-react-native