I do not know if you have seen Google's official training courses, yesterday I was watching Actionbar this section of the time, there is a problem has been troubling me. The link to this guide I put on the following first. You can go and see more documents and definitely get more.
Http://developer.android.com/guide/topics/ui/actionbar.html
There was a passage, and I intercepted it and looked at it with the rest of us.
I this small rookie to offer an ugly, translation, translation of bad words, do not want to hit me ah.
Use logo to replace icon
By default, your app's icon is displayed on the action bar in the <application> or <activity> tab via the Android:icon property, but we can also use Android: Logo properties to specify a different icon to display.
A logo should usually be a little wider than the icon, but it should not contain unnecessary text. A reasonable usage scenario is that the logo should be well known to your users, and it represents your brand's logo. YouTube's mobile client is a good example--logo represents the user's intended logo, and the app icon is a modified version that is required to cater to the application's launch Icon square shape.
So curious I immediately created a new project on Android studio, try this feature, and then the sad things came. It is useless to change the logo, this is not a good idea. So I Google a bit, found a way to let it appear, But a little more trouble. You need to add a few words to the OnCreate () method. (It is emphasized that the activity parent class in the project is actionbaractivity, and if the parent is activity, there is no such problem.)
ActionBar ActionBar = Getsupportactionbar (); Actionbar.setdisplayshowhomeenabled (true); Actionbar.setlogo (R.drawable.ic_action_refresh); Actionbar.setdisplayuselogoenabled (TRUE);
This will show the logo, like this.
This is the only way I know to solve the problem at the moment. I also see a saying is that in the latest update, Google said, has recommended the compatibility package in the toolbar replace the original Actionbar, mother ah I still do not understand, and so I see the latest API back to update.
"Android" question about Actionbar can't display logo