I want to display both icon and title in the action bar of an Activity. Here is the screenshot of my app now:
Now I need the app logo be displayed to the left of MyApp text in the action bar. I have already tried the following code to set the logo but nothing happened:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setLogo(R.drawable.ic_launcher_web);
getSupportActionBar().setDisplayUseLogoEnabled(true);
setContentView(R.layout.activity_main);
}