今日はAndroidアプリケーションを始めたばかりなので、jarを追加していません。役立つ場合は、現在sdkとadt r19を使用しています。Android マニフェストの外観
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LoginActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".UserHome"></activity>
</application>
それがどのように起こったか:
btnLogin.setOnClickListener(new OnClickListener(){
public void onClick(View arg0){
Intent mapIntent = new Intent(LoginActivity.this, UserHome.class);
LoginActivity.this.startActivity(mapIntent);
Log.i("Intent", "Login to UserHome");
}
});
なぜこれが起こっているのか、私にはわかりません。
編集
エラーログ
07-13 06:14:06.844: E/AndroidRuntime(442): FATAL EXCEPTION: main
07-13 06:14:06.844: E/AndroidRuntime(442): java.lang.NoClassDefFoundError: com.srd.application.UserHome
07-13 06:14:06.844: E/AndroidRuntime(442): at com.srd.application.LoginActivity$1.onClick(LoginActivity.java:70)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.View.performClick(View.java:2408)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.View.onKeyUp(View.java:4121)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.widget.TextView.onKeyUp(TextView.java:4431)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.KeyEvent.dispatch(KeyEvent.java:1061)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.View.dispatchKeyEvent(View.java:3740)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
07-13 06:14:06.844: E/AndroidRuntime(442): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1667)
07-13 06:14:06.844: E/AndroidRuntime(442): at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1102)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.app.Activity.dispatchKeyEvent(Activity.java:2063)
07-13 06:14:06.844: E/AndroidRuntime(442): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1643)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2471)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2441)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.view.ViewRoot.handleMessage(ViewRoot.java:1735)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.os.Handler.dispatchMessage(Handler.java:99)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.os.Looper.loop(Looper.java:123)
07-13 06:14:06.844: E/AndroidRuntime(442): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-13 06:14:06.844: E/AndroidRuntime(442): at java.lang.reflect.Method.invokeNative(Native Method)
07-13 06:14:06.844: E/AndroidRuntime(442): at java.lang.reflect.Method.invoke(Method.java:521)
07-13 06:14:06.844: E/AndroidRuntime(442): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-13 06:14:06.844: E/AndroidRuntime(442): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-13 06:14:06.844: E/AndroidRuntime(442): at dalvik.system.NativeStart.main(Native Method)