The Android Progress bar not showing up











up vote
0
down vote

favorite












This is my layout xml:



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fragment_body"
android:fitsSystemWindows="true">

<include
android:id="@+id/contextToolBar"
layout="@layout/context_toolbar_layout" />

<android.support.v7.widget.RecyclerView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/contextToolBar"
android:scrollbarSize="5dp"
android:scrollbarThumbVertical="@color/scrollbarColor"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<ProgressBar
android:id="@+id/delete_progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />




It displays a grid of images in the recyclerview.
I can select a bunch of images & have an option to delete them.
The following is the delete logic:



public void deleteSelectedFiles(final Context context, final List<MediaModel> selectionList) {

String confirmationMessage = getString(R.string.delete_confirm_message);

new AlertDialog.Builder(context)
.setTitle(getString(R.string.action_delete))
.setMessage(confirmationMessage)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, (dialog, whichButton) -> {
View progressBar = getActivity().findViewById(R.id.delete_progress);
dialog.cancel();
progressBar.setVisibility(View.VISIBLE);

deleteFileList(selectionList, this.getActivity());

progressBar.setVisibility(View.GONE);
})
.setNegativeButton(android.R.string.no, null).show();
}


I am expecting the progress bar to display in the foreground while the delete operation is going on. But it just doesn't show up. Any help would be highly appreciated.










share|improve this question
























  • Upload your project to github and share a link so I can take a look
    – Skemelio
    Nov 11 at 10:05










  • @Skemelio I am not sure if I can do that since it is for a commercial application.
    – Adi
    Nov 11 at 10:35










  • Do you set the progressbar invisible anywhere in the project?
    – Skemelio
    Nov 11 at 10:52










  • As you understand without seeing code we can only take guesses
    – Skemelio
    Nov 11 at 10:54















up vote
0
down vote

favorite












This is my layout xml:



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fragment_body"
android:fitsSystemWindows="true">

<include
android:id="@+id/contextToolBar"
layout="@layout/context_toolbar_layout" />

<android.support.v7.widget.RecyclerView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/contextToolBar"
android:scrollbarSize="5dp"
android:scrollbarThumbVertical="@color/scrollbarColor"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<ProgressBar
android:id="@+id/delete_progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />




It displays a grid of images in the recyclerview.
I can select a bunch of images & have an option to delete them.
The following is the delete logic:



public void deleteSelectedFiles(final Context context, final List<MediaModel> selectionList) {

String confirmationMessage = getString(R.string.delete_confirm_message);

new AlertDialog.Builder(context)
.setTitle(getString(R.string.action_delete))
.setMessage(confirmationMessage)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, (dialog, whichButton) -> {
View progressBar = getActivity().findViewById(R.id.delete_progress);
dialog.cancel();
progressBar.setVisibility(View.VISIBLE);

deleteFileList(selectionList, this.getActivity());

progressBar.setVisibility(View.GONE);
})
.setNegativeButton(android.R.string.no, null).show();
}


I am expecting the progress bar to display in the foreground while the delete operation is going on. But it just doesn't show up. Any help would be highly appreciated.










share|improve this question
























  • Upload your project to github and share a link so I can take a look
    – Skemelio
    Nov 11 at 10:05










  • @Skemelio I am not sure if I can do that since it is for a commercial application.
    – Adi
    Nov 11 at 10:35










  • Do you set the progressbar invisible anywhere in the project?
    – Skemelio
    Nov 11 at 10:52










  • As you understand without seeing code we can only take guesses
    – Skemelio
    Nov 11 at 10:54













up vote
0
down vote

favorite









up vote
0
down vote

favorite











This is my layout xml:



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fragment_body"
android:fitsSystemWindows="true">

<include
android:id="@+id/contextToolBar"
layout="@layout/context_toolbar_layout" />

<android.support.v7.widget.RecyclerView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/contextToolBar"
android:scrollbarSize="5dp"
android:scrollbarThumbVertical="@color/scrollbarColor"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<ProgressBar
android:id="@+id/delete_progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />




It displays a grid of images in the recyclerview.
I can select a bunch of images & have an option to delete them.
The following is the delete logic:



public void deleteSelectedFiles(final Context context, final List<MediaModel> selectionList) {

String confirmationMessage = getString(R.string.delete_confirm_message);

new AlertDialog.Builder(context)
.setTitle(getString(R.string.action_delete))
.setMessage(confirmationMessage)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, (dialog, whichButton) -> {
View progressBar = getActivity().findViewById(R.id.delete_progress);
dialog.cancel();
progressBar.setVisibility(View.VISIBLE);

deleteFileList(selectionList, this.getActivity());

progressBar.setVisibility(View.GONE);
})
.setNegativeButton(android.R.string.no, null).show();
}


I am expecting the progress bar to display in the foreground while the delete operation is going on. But it just doesn't show up. Any help would be highly appreciated.










share|improve this question















This is my layout xml:



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/fragment_body"
android:fitsSystemWindows="true">

<include
android:id="@+id/contextToolBar"
layout="@layout/context_toolbar_layout" />

<android.support.v7.widget.RecyclerView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/contextToolBar"
android:scrollbarSize="5dp"
android:scrollbarThumbVertical="@color/scrollbarColor"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<ProgressBar
android:id="@+id/delete_progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />




It displays a grid of images in the recyclerview.
I can select a bunch of images & have an option to delete them.
The following is the delete logic:



public void deleteSelectedFiles(final Context context, final List<MediaModel> selectionList) {

String confirmationMessage = getString(R.string.delete_confirm_message);

new AlertDialog.Builder(context)
.setTitle(getString(R.string.action_delete))
.setMessage(confirmationMessage)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, (dialog, whichButton) -> {
View progressBar = getActivity().findViewById(R.id.delete_progress);
dialog.cancel();
progressBar.setVisibility(View.VISIBLE);

deleteFileList(selectionList, this.getActivity());

progressBar.setVisibility(View.GONE);
})
.setNegativeButton(android.R.string.no, null).show();
}


I am expecting the progress bar to display in the foreground while the delete operation is going on. But it just doesn't show up. Any help would be highly appreciated.







android android-layout android-recyclerview progress-bar android-progressbar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 19:47

























asked Nov 10 at 19:04









Adi

981110




981110












  • Upload your project to github and share a link so I can take a look
    – Skemelio
    Nov 11 at 10:05










  • @Skemelio I am not sure if I can do that since it is for a commercial application.
    – Adi
    Nov 11 at 10:35










  • Do you set the progressbar invisible anywhere in the project?
    – Skemelio
    Nov 11 at 10:52










  • As you understand without seeing code we can only take guesses
    – Skemelio
    Nov 11 at 10:54


















  • Upload your project to github and share a link so I can take a look
    – Skemelio
    Nov 11 at 10:05










  • @Skemelio I am not sure if I can do that since it is for a commercial application.
    – Adi
    Nov 11 at 10:35










  • Do you set the progressbar invisible anywhere in the project?
    – Skemelio
    Nov 11 at 10:52










  • As you understand without seeing code we can only take guesses
    – Skemelio
    Nov 11 at 10:54
















Upload your project to github and share a link so I can take a look
– Skemelio
Nov 11 at 10:05




Upload your project to github and share a link so I can take a look
– Skemelio
Nov 11 at 10:05












@Skemelio I am not sure if I can do that since it is for a commercial application.
– Adi
Nov 11 at 10:35




@Skemelio I am not sure if I can do that since it is for a commercial application.
– Adi
Nov 11 at 10:35












Do you set the progressbar invisible anywhere in the project?
– Skemelio
Nov 11 at 10:52




Do you set the progressbar invisible anywhere in the project?
– Skemelio
Nov 11 at 10:52












As you understand without seeing code we can only take guesses
– Skemelio
Nov 11 at 10:54




As you understand without seeing code we can only take guesses
– Skemelio
Nov 11 at 10:54

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242430%2fthe-android-progress-bar-not-showing-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242430%2fthe-android-progress-bar-not-showing-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

さくらももこ

13 indicted, 8 arrested in Calif. drug cartel investigation