The first way:
Requestwindowfeature (Window.feature_no_title);
Note that this method is not used when the inherited class is appcompatactivity, as follows, to change it to activity
public class Mainactivity extends appcompatactivity
The correct wording is:
public class Mainactivity extends activity {//Inherit activity//... @Override protected V OID onCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Requestwindowfeature (Window.feature_no_title); Written in front of the Setcontentview () function Setcontentview (R.layout.activity_listview); //... }
The second way:
Getsupportactionbar (). Hide ();
The inherited class is appcompatactivity, as follows
public class Mainactivity extends appcompatactivity {@Override protected void onCreate (Bundle savedinstancestate) { Super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_listview); Getsupportactionbar (). Hide (); Written behind the Setcontentview () function//...}
Beginner, write this note.
Android Development hidden title bar issues