content: package com.example.kaiyicky.myapplication;
  
  
  import android.animation.ObjectAnimator;
  import android.content.ComponentName;
  import android.content.Intent;
  import android.content.ServiceConnection;
  import android.os.Bundle;
  import android.os.IBinder;
  import android.os.RemoteException;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.view.PagerAdapter;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ListView;
  
  import com.example.kaiyicky.myapplication.SuperLoadingProgress;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  
  
  public class MainActivity extends FragmentActivity {
      SuperLoadingProgress mSuperLoadingProgress;
      
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          mSuperLoadingProgress = (SuperLoadingProgress) findViewById(R.id.pro);
          findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  new Thread(){
                      @Override
                      public void run() {
                          try {
                              mSuperLoadingProgress.setProgress(0);
                              while(mSuperLoadingProgress.getProgress()<100) {
                                  Thread.sleep(10);
                                  mSuperLoadingProgress.setProgress(mSuperLoadingProgress.getProgress() + 1);
                              }
                              mSuperLoadingProgress.finishFail();
                          } catch (InterruptedException e) {
                              e.printStackTrace();
                          }
                      }
                  }.start();
              }
          });
  
          findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  new Thread(){
                      @Override
                      public void run() {
                          try {
                              mSuperLoadingProgress.setProgress(0);
                              while(mSuperLoadingProgress.getProgress()<100) {
                                  Thread.sleep(10);
                                  mSuperLoadingProgress.setProgress(mSuperLoadingProgress.getProgress() + 1);
                              }
                              mSuperLoadingProgress.finishSuccess();
                          } catch (InterruptedException e) {
                              e.printStackTrace();
                          }
                      }
                  }.start();
              }
          });
      }
      
  }
  