13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ActionbarにprogressBarを表示する

Last updated at Posted at 2014-07-03

始めに

ActionBarにProgressBarを簡単に表示する方法があったのでメモ

Google+とかのアプリで使われているあれを簡単につけることができる

スクリーンショット 2014-07-03 10.11.52.png

方法

OnCreateでViewをセットする前にrequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS)を呼び出す。
setProgressBarIndeterminateVisibility(true);で表示、非表示を取得できる。
Fragment内で使いたい場合はいつも通りgetActivity().setProgressBarIndeterminateVisibility(false);とかすればOK
  
  

OnCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    ... // set layout etc

参考サイト stackoverflow

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?