Hi,
I'm looking to have a custom component (an extended EditText) that
uses its own input method. I've created the input method and the
custom component without issues, but I'm having trouble getting the
component to use the input method. I can use the input method with
the component if I use it as the default IME for the system...but I
only want to use it for this component type, not everything in the
system, or even everything in the app.
In particular, if I specify the android:inputMethod in the XML when
laying out the component, it can't find the class when it loads the
component:
<com.test.z800h.display.control.ValidatedNumber
...
android:inputMethod="com.test.z800h/.Z800HInput"
...
/>
leads to:
08-01 19:55:45.620: E/AndroidRuntime(5059): Caused by:
java.lang.ClassNotFoundException: com.test.z800h/.Z800HInput
I've also tried "com.test.z800h.input.Z800HInput" and "com.test.z800h/
input.Z800HInput". The fully qualified class name is
com.test.z800h.input.Z800HInput.
This is strange, because this code works:
Class<?> c;
try {
c = Class.forName("com.test.z800h.input.Z800HInput");
} catch (ClassNotFoundException ex) {
throw new RuntimeException(ex);
}
Maybe TextView uses a different class loader that doesn't index the
app's package.
Of course, I know android:inputMethod is deprecated. From what I can
tell, there really isn't another way to specify an exact input method
for a control. I'd be happy to do it in a non-deprecated way if there
is one.
Thanks,
Todd Sjolander
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en