Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Tuesday, December 22, 2015

Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app

Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


This is in the design interface.

enter image description here

This is the emulator.

enter image description here

The blue bar comes out of nowhere. I tried something like NoTitleBar, and the app just crashes. Someone help me Please!

Answer by Dhawal Sodha Parmar for Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


use theme with actionbar like Theme.AppCompat.Light.DarkActionBar and in your activity use getSupportActionbar().hide(); in onCreate before setContentView()

Answer by k0sh for Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


change your theme in styles.xml to Theme.AppCompat.Light.NoActionBar no extra code needed!

Answer by Virus for Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


Extend just Activity instead of AppCompatActivity in your Java class and the toolbar would be gone.

And remove the code referencing toolbar from onCreate() (if any was generated) and anywhere else (if you manually added) after changing the extended class, else you may see errors.

Answer by Survivor for Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


   

make sure you are not using getActionbar() or getSupportedActionbar in any activity that using this theme otherwise you will get NullPointerException

Answer by Sachin Parashar for Android Studio: How to avoid auto-creation of ActionBar/Toolbar in the app


If any of the above doesn't work then, create a new style in your Style.xml file

   

And in AndroidManifest.xml file, set your activity theme to the one you create :

  


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.