I have different Activities
in my App and in all of them I do not want the Action Bar
. I cannot find how to disable it. I have tried to find an attribute to apply it to the main_activity.xml
but so far I did not find anything. Can somebody help me please?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
Haha, I have been stuck at that point a while ago as well, so I am glad I can help you out with a solution, that worked for me at least :)
What you want to do is define a new style within values/styles.xml so it looks like this
Only the NoActionBar style is intresting for you. At last you have to set is as your application's theme in the AndroidManifest.xml so it looks like this
I hope this helps, if not, let me know.
If you want most of your activities to have an action bar you would probably inherit your base theme from the default one (this is automatically generated by Android Studio per default):
And then add a special theme for your bar-less activity:
For me, setting actionBarTheme to @null was the solution.
Finally setup the activity in your manifest file:
You may also change inheritance from ActionBarActivity to Activity as written here.
UPDATE
A good solution is here:
Create an new Style with any name, in my case "Theme.Alert.NoActionBar"
set its parent as "Theme.AppCompat.Dialog" like in the above code
open AndoridManifest.xml and customize the activity you want to show as Alert Dialog like this
in my app i want show my user login activity as Alert Dialog, these are the codes i used. hope this works for you!!!