android.settings.INPUT_METHOD_SETTINGS不能与HTC Hero的工作 [英] android.settings.INPUT_METHOD_SETTINGS doesn't work with HTC hero

查看:455
本文介绍了android.settings.INPUT_METHOD_SETTINGS不能与HTC Hero的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个按钮,将用户的区域设置。
我做这个code:

My application has a button that sends the user to the locale setting. I do this with this code:

startActivity(new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS));

这正常工作与一些设备,但与HTC Hero的我得到:

This works fine with some devices, but with the HTC Hero I get:

02-03 13:59:27.501: INFO/ActivityManager(69): Starting activity: Intent { action=android.settings.INPUT_METHOD_SETTINGS flags=0x10000000 }
02-03 13:59:27.531: DEBUG/AndroidRuntime(1916): Shutting down VM
02-03 13:59:27.531: WARN/dalvikvm(1916): threadid=3: thread exiting with uncaught exception (group=0x40013140)
02-03 13:59:27.531: ERROR/AndroidRuntime(1916): Uncaught handler: thread main exiting due to uncaught exception
02-03 13:59:27.611: ERROR/AndroidRuntime(1916): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.settings.INPUT_METHOD_SETTINGS flags=0x10000000 }
02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1529)
02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1499)
02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Activity.startActivityForResult(Activity.java:2669)
02-03 13:59:27.611: ERROR/AndroidRuntime(1916):     at android.app.Activity.startActivity(Activity.java:2713)

编辑:
解决方案!

SOLUTION!

Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
ComponentName com = new ComponentName("com.android.settings", "com.android.settings.LanguageSettings");
intent.setComponent(com); startActivity(intent);

在previous code将每个设备上工作:)

The previous code will work on every device :)

推荐答案

据官方统计,你可能无法修复它。 HTC显然打破了正在运行的特定英雄固件SDK。您可以使用 android.os.Build 来确定你是一个英雄,并禁用任何选项导致失败的 startActivity()调用(如禁用菜单选项试图打开这些设置)。

Officially, you probably cannot fix it. HTC apparently broke the SDK with the particular Hero firmware you are running. You can use android.os.Build to identify that you are on a Hero and disable whatever option leads to the failing startActivity() call (e.g., disable the menu choice that tries to open up these settings).

非官方,尝试通过设置应用程序手动去那个画面,看看在LogCat中输出。你也许能够确定的方式,可以触发你所寻求的特定屏幕的意图,如果存在。

Unofficially, try going to that screen manually via the Settings application, and take a look at the LogCat output. You might be able to determine that way an Intent that can trigger the specific screen you seek, if one exists.

这篇关于android.settings.INPUT_METHOD_SETTINGS不能与HTC Hero的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆