How to enable navigation click only after a http call has been made?

I have a problem in my Android app.

I have a bottom navigation menu for navigating through fragments of MainActivity. Problem is that on 3 of those fragments, I am making a http call that retrieves the data for those fragments. If I click a navigation item too soon, and another fragment loads before the http is resolved, my application crashes because it tries to load the data into view items that no longer exist.

My question is, how can I disable bottom navigation untill the http request loads the data?

Read more here:

Content Attribution

This content was originally published by perun_the_mighty at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: