/** * 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); }
/** * 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); }
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.mipmap.ic_launcher);
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_dialog);