0

私のコードはオンに設定されていましたが、取得できるようにAPI 7変更しましたAPI 15onGenericMotionListener

今、私は自分の活動を次のように定義しています:

  newGame.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                vibe.vibrate(vibValue);

                   if (levelStage == 1 && levelId == 1)
                   {       
                       Intent myIntent = new Intent(v.getContext(), Level.class);
                       startActivity(myIntent);
                   }
                   else
                       displayAlertForNewGame(v.getContext());
            }
        });

このアクティビティを起動しようとするたびにエラーが発生しますjava.lang.NoClassDefFoundError

このコードを使用してアクティビティを開始します

Intent myIntent = new Intent(v.getContext(),myActivity.class);
                        startActivity(myIntent);


05-22 22:49:20.416: E/AndroidRuntime(6327): FATAL EXCEPTION: main
05-22 22:49:20.416: E/AndroidRuntime(6327): java.lang.NoClassDefFoundError: com.code.global.Level
05-22 22:49:20.416: E/AndroidRuntime(6327):     at com.umar.regGame.MainMenu$1.onClick(MainMenu.java:67)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.view.View.performClick(View.java:2449)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.view.View$PerformClick.run(View.java:9027)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.os.Handler.handleCallback(Handler.java:587)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.os.Looper.loop(Looper.java:123)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at java.lang.reflect.Method.invokeNative(Native Method)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at java.lang.reflect.Method.invoke(Method.java:521)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-22 22:49:20.416: E/AndroidRuntime(6327):     at dalvik.system.NativeStart.main(Native Method)

よろしくお願いします

4

1 に答える 1

0

The problem comes from the class com.code.global.Level. Where does this class come from ? Is it in a jar, do you include it in the right way in your build path ?

于 2012-05-23T05:17:24.387 に答える