In my activity_main.xml i have this toolbar:
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#770000ff"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
In Manifest there is that in <application>
:
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
In res/values/style.xml
i have
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
The MainActivity.java
file is that:
import ... ;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
}
}
Now, the toolbar has only the application name and nothing else. How can i add items with icon such as https://i.stack.imgur.com/y29jV.png ?