android spinner is showing hidden notification bar - android

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

Related

Hide Title Bar in Service.Is it possible?

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.

Multiple progressbar progress value incorrect android

I have a View with multiple progress bars.Individual progress bars doesnt persist their value when i switch to last tab(tab 4) and i come back.[Basically when home tab is not visible and brought to visibility again].
The progress bars are placed inside a LinearLayout which is hosted inside Fragment. Looks like Youtube app. In home page, i have 5 progress bar.
For the first time when i set progress all progress bar values looks perfect.
Individual progress bar are showing their own individual values.
However when i switch to tab 4(not in picture), i come back, all progress bar's value get set to the last progress bar's value. See Image below.
I checked by removing Progress bar with TextBox, the value persists as per set.
I have added max value to progress bar, used the methods 1. setProgress, 2. incrementProgressBy, no improvement.
Since textbox behaves correctly ,i couldnt figure out my problem kindly help.
PS: In android Fragment(tab) gets recreated when its not visible and brought to visibility.to avoid this i made restrictions in onCreateview to persist the last created rootview.
You probably have solved this by now, but in case anyone else gets to this page with the same issue: I had the same problem, multiple progressbars in fragments in a tabbed container view (ViewPager), and all of them showing the same progress value (the one last set) after switching between tabs. I solved it by setting the progress value in the fragment's onResume instead of onCreateView.
I had the same problem with 2 progressBars inside a ViewPager and fixed by using a unique drawable instance for each progressBar:
This shows wrong values on progressBar:
val progressDrawable = ContextCompat.getDrawable(it, R.drawable.progress_bar_colors)
mBinding.firstProgressBar.progressDrawable = progressDrawable
mBinding.secondProgressBar.progressDrawable = progressDrawable
And this fixed the problem:
mBinding.firstProgressBar.progressDrawable = ContextCompat.getDrawable(it, R.drawable.progress_bar_colors)
mBinding.secondProgressBar.progressDrawable = ContextCompat.getDrawable(it, R.drawable.progress_bar_colors)
I hope it helps you
There is an accepted answer, but I ran into this same issue with multiple progress bars on different Fragments and in recycler views. My issue was related to a well observed Android progress bar bug that does not always update progress bars (see accepted answer here: android progressBar does not update progress view/drawable)
In my case I had a custom Progress Bar and added these methods to get around this bug. Sucks that we as developers have to figure this out the hard way so often.
fun setProgressSafely(progress: Int) {
setProgress(progress + 1)
setProgress(progress)
}
fun setMaxSafely(max: Int) {
setMax(max + 1)
setMax(max)
}

Very top bar with battery life and wifi status not showing up

Sorry for the simple question but I cant figure out whats going on with this. The theme of my layout is set to NoTitleBar and the gui shows that slim bar where you pull notifications down from but when I run my app on my galaxy nexus its not there. It just shows white space where that bar is supposed to be. How do I make this bar with battery life and such show up. thanks
check your activity declared in mainfest file ..put your theme as no title bar in your activity in manifest file..if problem is not solve then put your code for better understanding

Splashscreen - getActionBar().hide still flashes for a second

I am trying to implement a splashcreen and I dont want to use a new activity for the splashscreen,
So I set visibility=gone on my listview, hide actionbar, leave the logo visibility=visible, sleep for a certain period and then show the actionbar again and set the listview visibility back to visible
This works, however there is a brief moment at the start when the actionbar is still visible before it gets hidden
Is there a way to fix this and have the actionbar be gone from the beginning?
I am using ActionBarSherlock and Galaxy S3 with 4.1 Jelly Bean.
Thanks
No. There is no way to do this without using two separate activities.
The action bar is initialized as part of the decor view which happens much earlier than your onCreate method. This means there will be the noticeable lag that you describe before it can be hidden. If you wanted to permanently hide it you could do so using a theme or window flag but once you do that there is no way to get it to appear.

Android: Getting an issue of hiding title and status bar

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..

Categories

Resources