When i use Alert Dialog along with this
dialog.requestWindowFeature(Windows.FEATURE_NO_TITLE);
After using this ,the title bar comes for a few second and then vanishes.
How to handle this?
In your XML use this theme
android:theme="#android:style/Theme.NoTitleBar"
This will help you regarding your issue.
Related
I want to hide title bar in Service without using Activity.Can I somehow do so?I thought it might work with requestWindowFeature and NO_TITLE_FEATURE but android studio says that it can't resolve this method.May be somebody can help me?
No, the title bar is part of the Activity. Therefore the Activity must control what window features it uses or doesn't use.
I have a small Problem. In my application I have added theme on the application node through manifest as below.
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
Now my app doesn't show proper contextual action bar (see screenshot).
If i remove the theme then i don't find this error,but i need my app to be working in full screen mode.
**How i can achieve my desired result?. **
I think this is happening because of your text selection. so if you want you can avoid edit text selection by
android:textIsSelectable="false"
I hope it'll resolve your problem
I am hiding status bar and title bar throught out my app by adding
android:theme="#android:style/Theme.NoTitleBar" in android manifest xml file. I am also adding
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
in each activity. I am able to hide them. But sometimes when my app is loaded it is pushing the page down by taking the statusbar and title bar space.
Can any one of you please help me.
You should declare one of the above things not both. Either you declare it in the manifest or do it programmatically. Performing both the tasks as you just mentioned can hamper the screen. See this for more details
Declare any one of them and clean and run the program once..
In my app i make the app fullscreen. Means android title bar and notification bar is hidden here.
But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case.
I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it.
In my app i make the app fullscreen. Means android title bar and notification bar is hidden here.
But when i click on the spinner the hidden notification bar gets visible for fraction of seconds. It is not happening with all the spinners in my app. But where i use a array,generated by a loop execution in the spinner adapter, it is only happening in that case.
I have come to know that it is a known bug in android. I also use the following style in spinner to resolve it.
true
true
#null
But still i cant solve this problem..
If anyone has any solution please let me know.
add this line before setContentView():
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Then u use requestWindowFeature(Window.FEATURE_NO_TITLE); in activity and it must be before of the setContentView(....) method
I was wondering if there was any way to feature a custom title with my own drawable -- and then subsequently put a progress bar in the title layout so that it acts like the built in android progress bar.
In my code -- I want to be able to call setProgressBarIndeterminateVisibility(true) and have that display the progress bar in my custom title bar.
Is this possible?
I have set up my application theme so that it uses a custom title -- but I don't how or where to put the progress bar in that layout.
Thanks in advance.
EDIT: Right now I use my own theme that looks something like this:
<style parent="android:Theme.Light.NoTitleBar" name="BaseTheme">
<item name="android:windowBackground">#drawable/splash_bg</item>
<item name="android:windowTitleStyle">#style/TitleBackground</item>
</style>
With the title background style as :
<style name="TitleBackground" parent="android:WindowTitleBackground">
<item name="android:background">#drawable/title_bar</item>
</style>
To give everyone a better idea -- something like this.
Add this code in onCreate before any other code:
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
requestWindowFeature(Window.FEATURE_PROGRESS);
setProgress(xx); // Then use this to update the progress to xx amount
To turn on/off use
setProgressBarIndeterminateVisibility(false); //true to turn on.
I have used this in a login Activity, my problem is that I run most of the login async so I having problems updating the UI. But I do get the circular progress animation to display.
I have this working on a TabActivity being updated from an async call within an Activity Intent started by the TabActivity. I had to put the "requestWind...." lines in both the TabActivityand the called Activity. Also I have found using setProgress wasn't doing much, but the spinner animation was "spinning" the whole time so I'm happy.
Here is an great example of how to implement a custom title bar with a progress indicator:
http://downloadandroid.info/2010/08/creating-a-custom-titlebar/
My solution is to have an ActivityHelper class which extends Activity and includes this method as well as one to turn on or off the progress bar, then extend that class from each of my Activities.
I believe the only way to do it is to use your own custom title bar. You COULD override the android code since its open source -- but that might be a bad idea. The best thing to do is to make a title bar layout and just <include /> it in all the other layouts and maybe have a helper class to show and hide the progress bar.
In newer versions the technique of requestWindowFeature will not work. A better option would be to use the v7.widget.toolbar that google has provided. The following link gives proper detail on how to use it.
Setting up the Actionbar
http://developer.android.com/training/appbar/setting-up.html