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



Other Threads

1. coba diurutkan dari atas

Milestone gak masuk ? 


Sent from htc device powered by Robot-ijo

-----Original Message-----
From: Suyandi Liyis <m...@tokonavigasi.com>
Sender: id-android@googlegroups.com
Date: Wed, 24 Nov 2010 18:29:08 
To: id-android@googlegroups.com<id-android@googlegroups.com>
Reply-To: id-android@googlegroups.com
Cc: iklan-gadget<iklangad...@yahoogroups.com>
Subject: [id-android] coba diurutkan dari atas

cmiiw:
1. iphone 4
2. hd2 android
3. hd7
4. nexus one
5. omnia HD i8910HD
6. garmin oregon 550
7. n900
8. e52
9. nuvi 1250
10. ipod touch 3g
11. pusing kalau 2 org milis ketemu

syd
ptk

-- 
===============
"

-- 
===============
"

2. Automatic sqllite dbhelper class builder

Hi everybody, I already posted this here, but now I wrote a blogpost
on my (almost) brand new blog. Maybe somebody is interested in this
topic.

Link here: 
http://mytech{*filter*}ion.blogspot.com/2010/11/my-sqllite-helper-builder.html

-- 

3. how to implement Two line text with different colors on one button

4. Code for connecting webservices in android by using HttpClient

5. Looking for sources of Searchable Dictionary v2

6. Memory Leak with a ListView revisited

7. make JPEG image has map