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.
On Sep 22, 6:47 pm, Dianne Hackborn <[email protected]> wrote:
> This happens for every application that is loaded -- the resources are a
> combination of the framework and application resources, and all of the
> framework can freely access the application resources. This is generally
> accomplished by using a custom theme that references the app resources where
> desired.
>
> If you mean you want to install an app and have the framework magically load
> the app's resources and use something from it for all other apps, well of
> course you have the code and can do what you want. It's certainly not
> atypical to load one app's resources into another app -- for example this is
> how home and other such things show icons or labels associated with other
> applications. Context.createPackageContext() or the PackageManager API to
> get a package's resources are the typical mechanism for this.
>
>
>
> On Tue, Sep 22, 2009 at 5:59 PM, Andy Droid <[email protected]> wrote:
>
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---