Ошибка выдачи активности OnResume, ошибка просмотра исходного кода

1

Итак, супер происходит из MingleActivity, который расширяет Activity.It продолжает бросать ошибку на ActivityThread.performResumeActivity(IBinder, boolean). Мой Try/Catch просто выдает ошибку Java.lang.Nullpointerexception, поэтому на самом деле не очень много помогает. Он просто просит меня изменить исходный путь.

    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();
    }

}
Теги:
nullpointerexception
super
onresume

1 ответ

0
  1. Можно ли увидеть onResume() в MingleActivity?
  2. Почему вы завершаете вызов startAnimating() в блоке try/catch, когда метод не startAnimating() Exception?

Ещё вопросы

Сообщество Overcoder
Наверх
Меню