I want to load Keyboard object by using asset xml file.
Here is my test code.
Keyboard keyboard = new Keyboard(context, resId);
XmlResourceParser parser = null;
// test code
try {
parser = getAssets().openXmlResourceParser("test.xml");
} catch (IOException e1) {
e1.printStackTrace();
}
try {
Method method =
Keyboard.class.getDeclaredMethod("loadKeyboard",
new Class[] {
Context.class, XmlResourceParser.class
});
method.setAccessible(true);
method.invoke((Keyboard)keyboard, new Object[]
{context, parser});
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (NotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return keyboard;
But getAssets().openXmlResourceParser function not support the loading
from external resource.
That can only load from compiled xml.
Is there any good idea to make keyboard from external xml?
Please help me...
Thanks
--
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