2012-01-20 7 views
1

スーパーはActivityを拡張するMing​​leActivityから来ているので、ActivityThread.performResumeActivity(IBinder、boolean)でエラーをスローし続けます。 My Try/Catchは単にJava.lang.Nullpointerexceptionエラーをスローするので、実際には多くの助けが得られません。ソースパスを編集するよう依頼しています。OnResumeアクティビティのスローエラー、ソースルックアップの失敗

package mingle.mix; 

import android.content.Intent; 
import android.os.Bundle; 
import android.util.Log; 
import android.view.animation.Animation; 
import android.view.animation.AnimationUtils; 
import android.view.animation.Animation.AnimationListener; 

import android.widget.TextView; 
import android.widget.Toast; 

public class MingleSpalshActivity extends MingleActivity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.spalsh); 
     try 
     { 
     startAnimating(); 
     } 
     catch (Exception e) 
     { 
      // this is the line of code that sends a real error message to the log 
      Log.e("ERROR", "ERROR IN CODE: " + e.toString()); 

      // this is the line that prints out the location in 
      // the code where the error occurred. 
      e.printStackTrace(); 
     } 
    } 

    private void startAnimating() { 
     // Fade in top title 
     TextView logo1 = (TextView) findViewById(R.id.title_text); 
     Animation fade1 = AnimationUtils.loadAnimation(this, R.anim.fade_in); 
     logo1.startAnimation(fade1); 



     // Transition to Main Menu when bottom title finishes animating 
     fade1.setAnimationListener(new AnimationListener() { 

      public void onAnimationEnd(Animation animation) { 


       // The animation has ended, transition to the Main Menu screen 
       startActivity(new Intent(MingleSpalshActivity.this, MingleGameActivity.class)); 
       MingleSpalshActivity.this.finish(); 
       //Toast toast = Toast.makeText(getApplicationContext(), "A TOAST", Toast.LENGTH_SHORT); 
       //toast.show(); 
      } 

      public void onAnimationRepeat(Animation animation) { 
      } 

      public void onAnimationStart(Animation animation) { 
      } 
     }); 
} 
    @Override 
    protected void onPause() { 
     super.onPause(); 
     // Stop the animation 
     TextView logo1 = (TextView) findViewById(R.id.title_text); 
     logo1.clearAnimation(); 

     } 


    @Override 
    protected void onResume() 
    { 
     super.onResume(); 

     // Start animating at the beginning so we get the full splash screen experience 
     startAnimating(); 
    } 

} 

答えて

0
  1. 我々はMingleActivityonResume()を見ることができますか?
  2. メソッドがExceptionをスローしたときに、try/catchブロック内でstartAnimating()への呼び出しをラップするのはなぜですか?
関連する問題