Hello,

Trying to make it so that the default list highlight, (the orange
highlight, in the contacts list, for example)  will be changeable, at
the app layer.  In the file frameworks/base/core/java/android/widget/
AbsListView.java I modified the function:

 private void useDefaultSelector() {...}

from:

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


to:

        Context myContext = null;
        try {
                myContext = getContext().createPackageContext
("com.mycompany.myapp", 0);
        }
        catch (Exception e){
                // deal with exception
        }
        Resources r = null;
        try {
                r = myContext.getResources();
        }
        catch(Exception e ){
                // deal with exception
        }

        Drawable dr = null;
        int resID = r.getIdentifier("list_selector_background",
"drawable", "com.mycompany.myapp");
        try {
                dr = r.getDrawable(resID);
        }
        catch( Exception e){
                // // deal with exception
        }
        setSelector(dr);


Of course, I will put the correct xml file and .png's in the resources
folder of my app.

Should this work?  If so, how do I integrate this change, is it "mmm
frameworks/base" followed "make snod"?

thanks



--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to