2010-12-09 61 views

回答

37
@Override 
public void onCreate(Bundle icicle) { 
    super.onCreate(icicle); 
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 
    setContentView(R.layout.your_layout); 
} 

然后......在任何你想要的:

// then, you can do this to show the icon 
setProgressBarIndeterminateVisibility(true); 
//or to hide it 
setProgressBarIndeterminateVisibility(false); 

确保setContentView前使用requestWindowFeature

+0

太棒了!非常感谢你! ;-) – 2010-12-10 11:04:39