android.view.Window.setFeatureDrawableResource()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(67)

本文整理了Java中android.view.Window.setFeatureDrawableResource()方法的一些代码示例,展示了Window.setFeatureDrawableResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setFeatureDrawableResource()方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:setFeatureDrawableResource

Window.setFeatureDrawableResource介绍

暂无

代码示例

代码示例来源:origin: THEONE10211024/ApiDemos

/**
 * Initialization of the Activity after it is first created.  Must at least
 * call {@link android.app.Activity#setContentView setContentView()} to
 * describe what is to be displayed in the screen.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
  // Be sure to call the super class.
  super.onCreate(savedInstanceState);
  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().setTitle("This is just a test");
  getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
      android.R.drawable.ic_dialog_alert);
  Button button = (Button)findViewById(R.id.add);
  button.setOnClickListener(mAddContentListener);
  button = (Button)findViewById(R.id.remove);
  button.setOnClickListener(mRemoveContentListener);
}

代码示例来源:origin: qiubiteme/android_api_demos

/**
 * Initialization of the Activity after it is first created.  Must at least
 * call {@link android.app.Activity#setContentView setContentView()} to
 * describe what is to be displayed in the screen.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
  // Be sure to call the super class.
  super.onCreate(savedInstanceState);
  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().setTitle("This is just a test");
  getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
      android.R.drawable.ic_dialog_alert);
  Button button = (Button)findViewById(R.id.add);
  button.setOnClickListener(mAddContentListener);
  button = (Button)findViewById(R.id.remove);
  button.setOnClickListener(mRemoveContentListener);
}

代码示例来源:origin: ogarcia/opensudoku

getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
    R.mipmap.ic_launcher);

代码示例来源:origin: blurpy/kouchat-android

getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_dialog);

相关文章

微信公众号

最新文章

更多

Window类方法