2012-01-20 3 views
1

Super는 Activity를 확장하는 MingleActivity에서옵니다. 따라서 ActivityThread.performResumeActivity (IBinder, boolean)에서 오류가 계속 발생합니다. My Try/Catch는 단순히 Java.lang.Nullpointerexception 오류를 throw하므로 실제로 많은 도움을 얻지 못합니다. 소스 경로를 편집하도록 계속 요청합니다.OnResume Activity throwing 오류, 소스 조회 실패

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. 우리는 MingleActivity에서 onResume()를 볼 수 있을까요?
  2. 메서드가 Exception이 아닌 경우 try/catch 블록에서 startAnimating()에 대한 호출을 왜 포장하고 있습니까?