splashactivity.java显示错误

splashactivity.java显示错误,java,android,Java,Android,我的splashanimation.java文件有问题。它不断在setcontentview以及loadanimation上抛出错误。如果有人能为我指出解决这个问题的正确方向,我将不胜感激 我还尝试了清理项目以及删除问题错误。似乎什么都没用 我提前道歉我对java世界还是很陌生的 这是java文件 package com.android.club; import android.content.Intent; import android.os.Bundle; import android.v

我的
splashanimation.java文件有问题。它不断在
setcontentview
以及
loadanimation
上抛出错误。如果有人能为我指出解决这个问题的正确方向,我将不胜感激

我还尝试了清理项目以及删除问题错误。似乎什么都没用

我提前道歉我对java世界还是很陌生的

这是java文件

package com.android.club;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import com.android.club.R;

public class ClubSplashActivity extends ClubActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        startAnimating();
    }



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

        // Fade in bottom title after a built-in delay.
        TextView TextViewbottomTitle = findViewById(R.id.TextViewbottomTitle);
        Animation fade2 = AnimationUtils.loadAnimation(this, R.anim.fade_in2);
        TextViewbottomTitle.startAnimation(fade2);


        fade2.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationEnd(Animation animation) {

                startActivity(new Intent());
                ClubSplashActivity.this.finish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }
        });


        Animation spinin = AnimationUtils.loadAnimation(this, R.anim.custom_anim);
        LayoutAnimationController controller = new LayoutAnimationController(spinin);

        TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);
        for (int i = 0; i < table.getChildCount(); i++) {
            TableRow row = (TableRow) table.getChildAt(i);
            row.setLayoutAnimation(controller);
        }

    }

    protected void startActivity(Intent intent) {
        // TODO Auto-generated method stub

    }

    protected void finish() {
        // TODO Auto-generated method stub

    }

    private TextView findViewById(int textviewtoptitle) {
        // TODO Auto-generated method stub
        return null;
    }

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

        TextView logo1 = findViewById(R.id.TextViewTopTitle);
        logo1.clearAnimation();

        TextView logo2 = findViewById(R.id.TextViewbottomTitle);
        logo2.clearAnimation();

        TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);
        for (int i = 0; i < table.getChildCount(); i++) {
            TableRow row = (TableRow) table.getChildAt(i);
            row.clearAnimation();
        }
    }

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

        startAnimating();
    }

}

请发布日志cat详细信息,不要在自己的代码中创建类似
findViewById
的方法。您可能正在覆盖原始功能。为什么您需要实施自定义活动?我想我不必这么做,可能是我的想法太多了。您也可以发布您的俱乐部活动吗?
12-16 17:45:05.891: D/AndroidRuntime(944): Shutting down VM
12-16 17:45:05.891: W/dalvikvm(944): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
12-16 17:45:06.011: E/AndroidRuntime(944): FATAL EXCEPTION: main
12-16 17:45:06.011: E/AndroidRuntime(944): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.club/com.android.club.ClubActivity}: java.lang.ClassCastException: com.android.club.ClubActivity cannot be cast to android.app.Activity
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.os.Looper.loop(Looper.java:137)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread.main(ActivityThread.java:5041)
12-16 17:45:06.011: E/AndroidRuntime(944):  at java.lang.reflect.Method.invokeNative(Native Method)
12-16 17:45:06.011: E/AndroidRuntime(944):  at java.lang.reflect.Method.invoke(Method.java:511)
12-16 17:45:06.011: E/AndroidRuntime(944):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-16 17:45:06.011: E/AndroidRuntime(944):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-16 17:45:06.011: E/AndroidRuntime(944):  at dalvik.system.NativeStart.main(Native Method)
12-16 17:45:06.011: E/AndroidRuntime(944): Caused by: java.lang.ClassCastException: com.android.club.ClubActivity cannot be cast to android.app.Activity
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
12-16 17:45:06.011: E/AndroidRuntime(944):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
12-16 17:45:06.011: E/AndroidRuntime(944):  ... 11 more