Can a core class access resources at the app layer?

by Andy Droid » Wed, 23 Sep 2009 09:00:02 GMT


Sponsored Links
 Can a core class such as "AbsListView" access resources, such as xml
files, and .png's, in a 3rd party app installed in the normal way (at
the app level)?

I realize this is a change in framework code, and that is fine for my
purposes.  So, for example, if I know that I am going to install an
app called "MyApp", could I go into frameworks/base/core/java/android/
widget/AbsListView.java and tell it to use an xml file and .png's that
live in that app?  Here is the line I would want to modify:

setSelector(getResources().getDrawable(
 
com.android.internal.R.drawable.list_selector_background));

thanks



--~--~---------~--~----~------------~-------~--~----~



Can a core class access resources at the app layer?

by Andy Droid » Thu, 24 Sep 2009 05:47:04 GMT


 That's a great tip, I hadn't know about that.  But, I'm trying to make
it so that the default list selector will be changeable, at the app
layer.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Can a core class access resources at the app layer?

by Andy Droid » Fri, 25 Sep 2009 07:40:46 GMT


 Thanks, Dianne.  I tested your suggestion with two apps, where one app
gets resources from another app, and it worked.  Doing it at the
framework layer is more difficult, but it may be more of a build
problem.

I made a change to frameworks/base/core/java/android/widget/
AbsListView.java  did a "mmm frameworks/base", and then "make snod".
I don't *think* I saw my change reflected, but maybe you could tell me
if "make snod" should work, or if i need to do a full make.

But as another approach, I also wanted to ask this:  In the file
"list_selector_background.xml" located at frameworks/base/core/res/res/
drawable/, can I change the line:

<item android:state_focused="true"
        android:drawable="@drawable/list_selector_background_focus" />

to something that points to my resource, such as:

   <item android:state_focused="true"
        android:drawable="@drawable/
com.mycompany.myapp.my_list_selector_background_focus" />


Is there a way to do this?  thanks for your help.






--~--~---------~--~----~------------~-------~--~----~



Can a core class access resources at the app layer?

by Andy Droid » Fri, 25 Sep 2009 07:59:11 GMT


 hoops I thought this was android-platform, my bad. Anyway, yes I will
move it to android-porting.

On Sep 24, 4:48pm, Dianne Hackborn <hack...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~