Why doesn't w.requestFeature(Window.FEATURE_RIGHT_ICON);work?

by quill » Wed, 29 Apr 2009 16:39:36 GMT


Sponsored Links
 Hi all,
I just want to set an icon in the right of titlebar, so I use:
        Window  w = getWindow();
        w.requestFeature(Window.FEATURE_RIGHT_ICON);
        setContentView(R.layout.main);
        w.setFeatureDrawableResource(Window.FEATURE_RIGHT_ICON,
                        R.drawable.icon);
but it doesn't work, the icon is still at left. Did I miss something?
Pls help me, thx!
--~--~---------~--~----~------------~-------~--~----~



Why doesn't w.requestFeature(Window.FEATURE_RIGHT_ICON);work?

by Streets Of Boston » Wed, 29 Apr 2009 21:59:19 GMT


 It's a bug. I don't know if it's fixed in Cupcake, but in 1.1 and 1.0
this does not work. The icon will always be on the left.



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


Sponsored Links


Why doesn't w.requestFeature(Window.FEATURE_RIGHT_ICON);work?

by quill » Thu, 30 Apr 2009 09:29:51 GMT


 Hi, Streets!
My sdk is cupcake1.5, the bug still remains...(if it is a bug)




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



Why doesn't w.requestFeature(Window.FEATURE_RIGHT_ICON);work?

by Dianne Hackborn » Thu, 30 Apr 2009 10:12:04 GMT


 It's not a bug, you need to request all features before setContentView().








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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.

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



Why doesn't w.requestFeature(Window.FEATURE_RIGHT_ICON);work?

by quill » Thu, 30 Apr 2009 11:22:01 GMT


 Hi Dianne,
Do you mean I should put
w.setFeatureDrawableResource(Window.FEATURE_RIGHT_ICON,
                        R.drawable.icon);
before setContentView()? It still can't work.






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



Other Threads

1. System-wide touch events OR User activity

I have been searching for some time for a method to solve my problem.
I am pretty sure this isn't possible, but thought I would ask anyway.

The problem that exists for me is I need a way to recognize when the
user is currently on their phone.  Not specifically on my application
but on any application. I dont need any data on what apps there using
or anything like that, just simply that they are using it.

The idea I had, was to be able to listen to system touch events.
However, all I need is a true or false of whether or not a touch event
occurred anywhere on the system, in any application. I don't want to
know the coordinates of the touch event or what app it was in, just
simply that it happened.

OR

Maybe a way to detect if the current view has changed or something
like that.

Any help is appreciated.

-- 

2. how to detect whether android device supports audio & video recording

hi,
   Is there any api that can let me know whether android device
supports audio video recording.


Thanks,

-- 

3. How to get Memory Usage in android?

4. How to realize TextView control has wordwrap functionallity.

5. android.text.format.Time.parse3339

6. How would I include non-class files in my apk?

7. How would I include non-class files in my apk?