title: Reduce app CPU Usage in Android
body: <p>My app shows a splash screen for 4 seconds and then opens another activity with a web view.
  I am using a thread to splash the screen and finish() the first activity as soon as web view activity is started. I have also used animations like fade in and fade out.
  It's CPU usage is fluctuating between 8% to 23%.What could be the reason. I want to reduce the CPU usage.
    My first activity that shows splash screen and starts web view activity-</p>
  
  <pre><code>           public class MainActivity extends Activity {
  Thread splashThread;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      overridePendingTransition(R.animation.fadein,R.animation.fadeout); 
  
      getWindow().requestFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
      setContentView(R.layout.activity_main);
  }
  
  @Override
  protected void onStart() {
      // TODO Auto-generated method stub
       //-----------------------------------------
  
          splashThread=new Thread(){
          public void run()
          {
              try
              {   
                  sleep(1000);                    
              }
              catch(Exception e)
              {
                  e.printStackTrace();
              }
              finally
              {
                  Intent intent = new Intent(getApplicationContext(),OpenWeb.class);
                          startActivity(intent);
              }
          }
      };
      splashThread.start();
       //-----------------------------------------
  
      super.onStart();
      overridePendingTransition(R.animation.fadein, R.animation.fadeout);
  }
  @Override
  protected void onStop() {
      // TODO Auto-generated method stub
      finish();
      super.onRestart();
  } 
  }
  </code></pre>