The setProgressBarIndeterminateVisibility (false) function does not work for 2.3 android. I am using the code below. A progress bar is always displayed and not hidden. The same code works with android 4.x, and the progress bar is hidden. This activity is from SherlockFragmentActivity, and there is no call of type setSupportProgressBarIndeterminateVisibility (true); which will make the progress bar visible. My full code is:
@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 suggest a way so that I can hide the progress bar on android 2.x. Thanks
source share