Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (settings): Open Native Settings #86

Open
dtrigo opened this issue Feb 21, 2023 · 0 comments
Open

feat (settings): Open Native Settings #86

dtrigo opened this issue Feb 21, 2023 · 0 comments
Labels
feature Feature

Comments

@dtrigo
Copy link

dtrigo commented Feb 21, 2023

Is your feature request related to a problem? Please describe:
It would be great to implement a method to launch system's TTS Settings.

Describe the solution you'd like:
A new method like

@PluginMethod
    public void openTTSSettings(PluginCall call) {
        JSObject ret = new JSObject();
        final PackageManager manager = getContext().getPackageManager();
        Intent launchIntent = new Intent("com.android.settings.TTS_SETTINGS");

        try {
            getActivity().startActivity(launchIntent);
            ret.put("completed", true);
        } catch (Exception ex) {
            launchIntent = manager.getLaunchIntentForPackage(url);
            try {
                getActivity().startActivity(launchIntent);
                ret.put("completed", true);
            } catch (Exception expgk) {
                ret.put("completed", false);
            }
        }
        call.resolve(ret);
    }
@robingenz robingenz added the feature Feature label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature
Projects
None yet
Development

No branches or pull requests

2 participants