Subscribe to:
Post Comments
(
Atom
)
ActionBar in Android with Example
public class MainActivity extends AppCompatActivity { @Override protected void onCreate( Bundle savedInstanceState ) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // calling this activity's function to // use ActionBar utility methods ActionBar actionBar = getSupportActionBar(); // providing title for the ActionBar actionBar.setTitle(" GfG | Action Bar"); // providing subtitle for the ActionBar actionBar.setSubtitle(" Design a custom Action Bar"); // adding icon in the ActionBar actionBar.setIcon(R.drawable.app_logo); // methods to display the icon in the ActionBar actionBar.setDisplayUseLogoEnabled(true); actionBar.setDisplayShowHomeEnabled(true); }
Reviewed by TechTubeHQ
on
December 17, 2022
Rating: 5
No comments: