All views disappear when I select the apptheme .. android Studio? - android

put when I change the theme to (Holo Theme) it back again screen ..
apptheme:
holotheme:
Manifest:

Try to edit your res/values/style.xml e.g. :
<style name="AppTheme" parent="AppBaseTheme"/>
It is just an example. I think there's nothing behind your "AppTheme" right now.

Related

How can I disable that my Wear OS app closes when I swipe from left to right?

I did try this but did not work. Do I have to do more? Or is there another easy way?
You can Modify your theme style.
Add this to your style.xml file.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowSwipeToDismiss">false</item>
</style>
Then add theme style in your manifest file on targeted activity like this:
android:theme="#style/AppTheme"
This will disable swipe in the app or activity.

Why is my layout not showing in Android Studio?

As you can see, I have a text view and a button but none of it is showing on the device. The device is empty, so I'm wondering how can I get these things to show? Nothing so far has been working, I already tried clicking on the magic wand.
This is one of the problems, I Encountered while working in android.
You have to edit your res/values/styles.xml file
<!-- Base application theme. -->
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
Steps are as following:
Go to res/values/
open styles.xml
change from -> style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"
change to -> style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"
(Just prepend "Base." to "Theme".)
Save the file and check Preview now.
Preview will Work Perfeclty now.

Why does select theme in Android Studio cause my layout become different

i using android studio to start develop apps, but i have some question about "Select Theme" in android studio. First, i noticed i select "NoActionBar" option, the layout will be like
The statusbar has no color, but after when i change to "AppTheme", the layout became
I had double check the code in styles.xml, but there are no changes. I really can't figure out about this. Can anyone explain this to me? Thank in advance.
**I have figured out actually select theme only the preview, it doesn't change my XML layout.
you will find this in styles.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
In your layout, two things are happening here
1. Your layout have a toolbar in its xml. So toolbar always showing.
2. the above pic will give you an idea about how the material theme isapplying with colors.
Hope this helps you.
check the colorPrimary and the colorPrimaryDark in your color.xml file

Android studio preview pane not rendering ActionBar?

I'm running the latest version of android studio ,Problem is the preview pane does not render the ActionBar when any of the AppCompat themes are used, if i change the theme of the preview pane it works fine(Not change actual theme) ,but is there any discepency in doing this,
my styles.xml is as follows
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
when the preview pane is set to AppTheme ,the ActionBar ain't shown ,however it works fine in my device and AVD,
As you can see this makes it hard to debug and test the ActionBar
Please suggest some fix to this and how exactly does a AppCompat theme differ from an ordinary one?,I'm just an android beginner .
Thanks!
It is a bug: https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=78944
Unfortunately it is low priority.
Update: set the preview to API 22
In my styles.xml I had
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
had to change it to just
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
There is culprit in your MainActivity(which ever your activity) when your are using app.compact.v7 your are supposed to extend ActionBarActivity instead Activity

How to change menu theme in Android

My android application uses the following style:
<style name="AppTheme"
parent="android:style/Theme.Holo" ></style>
It is assigned for the whole application in the AndroidManifest.xml file :
<application
android:theme="#style/AppTheme"
[...]
Using this style, menus look like this :
However, if I use the light theme instead :
<style name="AppTheme"
parent="android:style/Theme.Light" ></style>
Menus will look like this :
My question is :
How can I apply the HOLO theme for the whole application and use only the LIGHT theme for menus ??
I just want to apply the dialog "style" of the LIGHT theme and apply the HOLO theme for everything else.
I believe you are looking for this:
<application
android:theme="#style/theme.holo.light>
Try to use "android:itemBackground" to change the background color of the menus
You can make your own white style. Put this into style.xml and give theme in AndroidManifest file this theme
<style name="MyGow.Default.NoActionBar" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">#color/silver</item>
<item name="android:actionModeBackground">#color/white</item>
</style>

Categories

Resources