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. automatic start using Alaram Manager problem

I created one application to start application After particular time
interval. My application working fine but it does not do particular
work
after particular time. I mean it does not used to start automatically
after the time which i set in AlaramManager.

My coding and xml file is as below.


The following is the code of my mail class which extends Activity. I
have done following thing in it

try
{




Intent intent = new Intent(Lalu_Android.this, OneShotAlarm.class);
PendingIntent sender = PendingIntent.getBroadcast(Lalu_Android.this,
0, intent, 0);

// We want the alarm to go off 30 seconds from now.
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, 15);

// Schedule the alarm!
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
tv.setText("Successful");
setContentView(tv);
//finish();

}
catch(Exception e)
{

tv.setText("Url not called successfully");
setContentView(tv);

}


The following is a class which extends BroadcastReceiver . Which
should
be invoked after particular time.

public class OneShotAlarm extends BroadcastReceiver
{
//Lalu_Android la=new Lalu_Android();
CallUrl ca;

//TextView tv = new TextView();
public void onReceive(Context context, Intent intent)
{
System.out.println("In one shot alaram");
Toast.makeText(context, "Alaram", Toast.LENGTH_SHORT).show();
ca=new CallUrl();
//Toast.makeText(context, R.string.one_shot_received,
Toast.LENGTH_SHORT).show();
/*Intent smsIntent = new Intent();
smsIntent.setClassName("com.android.hello",
"com.android.hello.SendSms");
//startActivity(smsIntent);
//la. */
}
}


The CallUrl is a another class which i want to execute its method
onCreate() when application starts by AlaramManager so i create the
object of it in the OneShotAlaram.


The following my xml file.



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.saltriver.android"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".Lalu_Android"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
<receiver android:name=".OneShotAlarm" />

</manifest>


I am in the big trouble i hope some one will reply me as early as
possible.
--~--~---------~--~----~------------~-------~--~----~

2. 鈼廇bout AndroidSurfaceOutput use PVPlayer as parameter in cupcake

In Cupcake branch:

The constructor of AndroidSurfaceOutput add a paramether PVPlayer. It
mean AndroidSurfaceOutput need know who is using this output.

path : external/opencore/android/android_surface_output.cpp
in about 1041
===============================================
    // update app
    mPvPlayer->sendEvent(MEDIA_SET_VIDEO_SIZE, displayWidth,
displayHeight);
===============================================

The displayWidth and displayHeight is the display size  set by
AndroidSurfaceOutput::setParametersSync.

It mean when the displaysize is  set , The AndroidSurfaceOutput need
notify the PVPlayer.
I have 3 question about it :
1.  AndroidSurfaceOutput is designed a passive output , so it looks
strange .

2.  In original design PVPlay will decode using the video size ,
AndroidSurfaceOutput work as output device , it may resize it to
display size.
So when PVPlay need know the display size ?
Do it only used by mediaplayer App ?

3. If the Surface is using hardware overlay , Does it has something
different for it ?






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

3. Internet on emulator

4. NFS Configuration on Zoom

5. how to remove the image displayed in ImageView

6. Anyone know how to use bookmarklets?

7. Google Apps and free apps on the marketplace