开发者

I'm making an Android IME. How do I add a "Settings" list item in the "Language & Keyboard" settings screen?

开发者 https://www.devze.com 2023-01-16 05:30 出处:网络
... like \"Swype settings开发者_如何学Go\" in this picture.Been searching for hours on how to do this.Going to go insane.Help appreciated.Finally found it by looking at the source code for S9.

... like "Swype settings开发者_如何学Go" in this picture. Been searching for hours on how to do this. Going to go insane. Help appreciated.


Finally found it by looking at the source code for S9.

In method.xml, you just add the attribute android:settingsActivity="com.package.SettingsClass" to <input-method>, so the entire file looks like:

<?xml version="1.0" encoding="utf-8"?>
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.package.SettingsClass" />


I haven't tried it myself but do you have the permissions and intent filters discussed in this Android Developers Blog? Particularly the optional Settings activity defined in the AndroidManifest.xml.

0

精彩评论

暂无评论...
验证码 换一张
取 消