hey..hi..please tell me if i want to show pop-up message after completing my progress bar which is on 1st activity. now i have created progress bar its runs but remaining part i want to show pop-message as progress bar reached the max. limit....please help me out
Have you tried using a Toast?
(You may also want to change the title of this submission to something more relevant.)
have a look at http://developer.android.com/reference/android/widget/ProgressBar.html#getProgress%28%29
and http://developer.android.com/reference/android/widget/ProgressBar.html#getMax%28%29
You can write something like
if (yourBar.getProgress() == yourBar.getMax()) do something
Related
What I want to do is get the get progress from the progress bar and put some text at the end of the progress bar.
I'm not sure how to do this
Since the UI has to be made variably and putting a text view there, it doesn't come up no matter how much I think about it, and even if I google it, it doesn't come up.
If you know how, please help.
i want like this
TextView on the right side of progress in ProgressBar
In a dialog fragment , when i use a progress bar (not progress dialog) I want to complete a task and then allow user interaction. It can be achieved with progress dialog by using setCancelable(false) , but how to do it with progress bar ?
(Since, getWindow() function doesn't work inside a dialog fragment).
Thank you in advance :)
I would not recommend you doing that since the idea of progress bar is to show the user that something is going on but it should not have anything to do with the fact that they can interact with the screen. (That's one of the reasons why ProgressDialog was deprecated, to encourage not to block the UI when something is loading).
Besides that, answering your question, getWindow can be called from the activity, you can retrieve the activity in your dialog fragment using either requireActivity().getWindow() or getActicity().getWindow() and set the params accordingly to disable user action.
You can simply add isLoading boolean flag, and forbid all interactions while that flag is true, and after the work is done, set that flag to false
I am developing an android app, in which I need a loading screen like the one given below. In this screen I want a custom progress bar and a loading text in the centre of the screen, and the background effect should be blurred. When the loading starts, the user should not be able to perform any action.
How can I create this type of loading screen?
#Ganpat Kaliya
Please check Transparent progress dialog on Android
Just set
setTitle(Loading...);
I would suggest you to use the custom Progress dialog. The purpose of using progress dialog is that as you wanted the screen to be blur, so when ever you would bring Progress dialog to front the activity would get blur , additionally it is highly customize able , you can do what you want.
A very useful explanation is here and here. please check them out and apply.
I'm really interested if I can create two dialogs in Android in same time in one activity. Here is what I want to achieve : I want to have a circle progress bar with a cancel button and at the bottom of my activity to have a horizontal progress dialog which indicates some calculations. Is there any option to create something like this or similar to this?
Thanks in Advance!
There is no reason why the synchronizing bar, progress bar, and cancel button could not be part of the same dialog that has a transparent background.
You can call
ProgressDialog#getWindow#setGravity(...) to change the gravity.
So:
ProgressDialog dialog = ProgressDialog.show(AContext, "Test", "On the bottom");
dialog.getWindow().setGravity(Gravity.BOTTOM);
You cannot show multiple dialogs at the same time, however you can create an activity with a transparent background which looks like two different dialogs.
Is it possible to add an activity indicator as a part of an alert? I need this because it is difficult to show alert view in white background. Please suggest ideas.
I was actually searching for progress dialog... loading indicator + message............