3

I'm attempting to upgrade my app to support Fire OS 5. One of my features is the ability to open specific Fire TV settings menus from within the application.

i.e. Clicking a button opens the Network Settings using the standard Lollipop constant (android.settings.WIRELESS_SETTINGS)

    Preference prefVirtualOpenNetworkSettings = (Preference) findPreference("prefVirtualOpenNetworkSettings");
    prefVirtualOpenNetworkSettings.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
    {
        @Override
        public boolean onPreferenceClick(Preference preference)
        {
            // Open ADB settings
            Intent networkSettingsOpenIntent = new Intent("android.settings.WIRELESS_SETTINGS");
            PreferenceActivity.this.getActivity().startActivity(networkSettingsOpenIntent);


            return false;
        }
    });

it appears that the Display menu (android.settings.DISPLAY_SETTINGS) and Time Zone (android.settings.DATE_SETTINGS) cause my application to crash within FireOS5.

Can someone please advise me as to what the comparable constants to the Display Menu and Time Zone menu within Fire OS 5 would be?

Thanks.

jediknight562
  • 121
  • 1
  • 9
  • 1
    Note that you can check if your `Intent` is valid at runtime (to avoid the crash, even if it's not an answer to your question): check if the result of `context.getPackageManager().queryIntentActivities(intent, 0)` is empty. If it is, the `Intent` must not be started (as no `Activity` can handle it). – Marc Plano-Lesay Dec 15 '15 at 18:04
  • "what the comparable constants to the Display Menu and Time Zone menu within Fire OS 5 would be?" -- there probably are none, if the standard ones do not work. Your app needs to be able to deal with devices that do and do not have support for those `android.settings` actions. – CommonsWare Dec 15 '15 at 18:07
  • @Kernald - Thanks. I will incorporate more logic around the activity to prevent crashing – jediknight562 Dec 15 '15 at 20:35
  • @CommonsWare - I was hoping that perhaps Amazon smashed somethings together at the SDK level that I wasn't aware of. Is there a way to look up see if all the constants that are available at runtime? i.e. Android Studios just has the core Android ones, not the Fire OS 5 flavor constants if that makes sense? – jediknight562 Dec 15 '15 at 20:37
  • "Is there a way to look up see if all the constants that are available at runtime?" -- you would have to inspect the manifest of their edition of the Settings app, bearing in mind that undocumented things are subject to change at any point. – CommonsWare Dec 15 '15 at 20:47

0 Answers0