getWindow(): Retrieve the current
Window
for the activity. This can be used to directly access parts of the Window API that are not available through Activity/Screen.
Sample code:
requestWindowFeature(Window.FEATURE_LEFT_ICON);
// See assets/res/any/layout/dialog_activity.xml for this
// view layout definition, which is being set here as
// the content of our screen.
setContentView(R.layout.dialog_activity);
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
android.R.drawable.ic_dialog_alert);
}
}
版权声明:本文为wwq_1111原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。