0

I would like to provide the possibility to change some settings of the Android keyboard (only this keyboard).


What I've tried:

1. Accessing the Shared Preferences: Can't be done, because they are internally.

2. Start the SettingsActivity: This crashes because the SettingsActivity is not exported. I also tried starting it with the package context of the Android keyboard.

3. Open the settings: Android proviedes some possibilities to open the system settings. But with them I can only open the system settings and not the IME settings.

Based on the documentation the SettingsActivity should receive an intent filter for ACTION_MAIN that indicates this activity is the main entry point for the IME application.


Can I change the settings of the keyboard somehow by myself? If this is not possible can I open the SettingsActivity?

devz
  • 2,629
  • 2
  • 31
  • 37

1 Answers1

1

I'm using LatinIME and this is how i open the settings

final Intent intent = new Intent();
intent.setClass(getApplicationContext(), SettingsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
        | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(SettingsActivity.EXTRA_SHOW_HOME_AS_UP, false);
intent.putExtra(SettingsActivity.EXTRA_ENTRY_KEY,false);
startActivity(intent);
remi0s
  • 87
  • 10
  • Are you using the LatinIME as library or where do you get the SettingsActivitiy? – devz Jul 09 '18 at 06:07
  • i'm developing an costume keyboard using the Android Opensource files for latinIME. which can me found [link](https://android.googlesource.com/platform/packages/inputmethods/LatinIME/) i understand my answer might not help you at all. I didnt understood correctly at first that you are trying to open the settins from another app. – remi0s Jul 10 '18 at 09:03
  • I would like to open the default Android keyboard settings, but this seems impossible. – devz Jul 10 '18 at 09:16