Reputation: 1268
I just started learning some Android Studio, but when I create a project, the "Hello World" template isn't showing on the preview window, even if I make changes or add elements to the xml layout. On my phone it shows perfectly, but I can't make it work on the IDE.
Upvotes: 3
Views: 1053
Reputation: 4365
This is a known bug. Here are the many options to fix it:
res/values
. Make sure you're using the parent="Theme.AppCompat.Light.NoActionBar"
theme, instead of the default. (If you want a dark theme, do the obvious and change it to Theme.AppCompat.Dark.NoActionBar
Why this happens/Why this fixes it:
For some reason, Android Studio still uses the deprecated ActionBar
by default and I don't think the layout editor supports it anymore. Thus it's crashing anonymously.
To use a Toolbar
since the ActionBar
is deprecated, follow this link:
https://developer.android.com/training/appbar/setting-up
(^ You can probably skip Step 1 in the above link)
Upvotes: 3