Siu Man Yu wrote:
> I have done some cusomtizations on general user interface behavior.
> 
> I would put those features into my applications. Therefore, I package
> my source code as a jar and add this external library to my
> applications.
> 
> As my cusomtization include some inflation of xml files, I put those
> resource in my package. However, when I finished compiled my
> application and ran it, it reports error. It seems cannot locate the
> xml file in the jar. (My debugger stop while inflate the xml file).
> 
> Do I miss any step to use my jar file?

JARs cannot package resources, and JARs cannot use R.* identifiers
(e.g., R.layout.main).

Distribute your resources separately and have applications using your
JAR merge your resources into their resource directory tree. Then,
modify your API to access resource identifiers as parameters, or use
getResources().getIdentifier() to (slowly) look them up by name.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Looking for Android opportunities? http://wiki.andmob.org/hado

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to