The setProgressBarIndeterminateVisibility(false) is not working for 2.3 android. I'm using the code below.The progress bar is show always and is not hidden. The same code is working on android 4.x and the progress bar is hidden. The activity is extending from SherlockFragmentActivity, and there is no call like setSupportProgressBarIndeterminateVisibility(true); that will make the progress bar visible. My complete code:
@Override
protected void onCreate(Bundle savedInstanceState) {
((SherlockFragmentActivity) JbActivity.this)
.requestWindowFeature((long) com.actionbarsherlock.view.Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
setSupportProgressBarIndeterminateVisibility(false);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
restart = false;
actionBar = getSupportActionBar();
if (SelectedItems.isNull()) {
restart = true;
try {
String jsonString = savedInstanceState
.getString("SelectedItems");
SelectedItems.build(jsonString);
} catch (Exception e) {
Intent mainIntent = new Intent(JbActivity.this,CityList.class);
mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mainIntent);
finish();
}
}
}
There is no place in the code where I call Can you please suggest a way so I can hide the progress bar on android 2.x. Thanks
Try using :
getSherlockActivity().setSupportProgressBarIndeterminateVisibility(false);
If you are calling it from a SherlockFragment
or just :
setSupportProgressBarIndeterminateVisibility(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With