1

Is it possible to change the action bar icon dynamically?

I have set it in my manifest. I want to change it and set it through the code.

My manifest:

 <activity android:name=".plugin.importer.face.FaceActivity" android:windowSoftInputMode="stateHidden|adjustResize" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.SYNC" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter android:icon="@drawable/new_enabled"> <action android:name="android.intent.action.INSERT" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 

Is there a way to do it?

Thank You.

1

1 Answer 1

5
 ActionBar actionBar = getSupportActionBar(); // || getActionBar(); actionBar.setIcon(getResources().getDrawable(R.drawable.new_enabled)); 

Hope that helps

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.