Bartos Bartos - 1 year ago 75
Android Question

Getting null at setting actionBar icon

I've got problem with my actionBar. Tryin' to set an icon but still getting null :/ Here's code :

protected void onCreate(Bundle savedInstanceState) {
getActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#51717e")));


Ofc I've got logo in my drawable folder. Both lines are incorrect - Icon and Background color. Help :/

Answer Source

Try to set the background and icon in your styles.xml

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download