设置在左边的图标
getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
setContentView(R.layout.main);
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.pic1);
设置在右边的图标
getWindow().requestFeature(Window.FEATURE_RIGHT_ICON);
setContentView(R.layout.main);
getWindow().setFeatureDrawableResource(Window.FEATURE_RIGHT_ICON, R.drawable.pic1);
注意:getWindow().requestFeature(Window.FEATURE_LEFT_ICON);必须要在setContentView前面使用