Estou com problema para chamar outra activity
. Segue código da Activity:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_principal);
}
public void entrarOnClick(View v) {
Intent intent = new Intent(this, Menu.class);
startActivity(intent);
}
}
e o androidmanifest
<activity
android:name=".Principal"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Menu"
android:label="Menu" >
</activity>
segue o logcat:
09-23 14:03:21.527: E/AndroidRuntime(2464): FATAL EXCEPTION: main
09-23 14:03:21.527: E/AndroidRuntime(2464): java.lang.IllegalStateException: Could not execute method of the activity
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.view.View$1.onClick(View.java:3599)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.view.View.performClick(View.java:4204)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.view.View$PerformClick.run(View.java:17355)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.os.Handler.handleCallback(Handler.java:725)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.os.Handler.dispatchMessage(Handler.java:92)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.os.Looper.loop(Looper.java:137)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.ActivityThread.main(ActivityThread.java:5041)
09-23 14:03:21.527: E/AndroidRuntime(2464): at java.lang.reflect.Method.invokeNative(Native Method)
09-23 14:03:21.527: E/AndroidRuntime(2464): at java.lang.reflect.Method.invoke(Method.java:511)
09-23 14:03:21.527: E/AndroidRuntime(2464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
09-23 14:03:21.527: E/AndroidRuntime(2464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
09-23 14:03:21.527: E/AndroidRuntime(2464): at dalvik.system.NativeStart.main(Native Method)
09-23 14:03:21.527: E/AndroidRuntime(2464): Caused by: java.lang.reflect.InvocationTargetException
09-23 14:03:21.527: E/AndroidRuntime(2464): at java.lang.reflect.Method.invokeNative(Native Method)
09-23 14:03:21.527: E/AndroidRuntime(2464): at java.lang.reflect.Method.invoke(Method.java:511)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.view.View$1.onClick(View.java:3594)
09-23 14:03:21.527: E/AndroidRuntime(2464): ... 11 more
09-23 14:03:21.527: E/AndroidRuntime(2464): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.radiosu/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Activity.startActivityForResult(Activity.java:3370)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Activity.startActivityForResult(Activity.java:3331)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Activity.startActivity(Activity.java:3566)
09-23 14:03:21.527: E/AndroidRuntime(2464): at android.app.Activity.startActivity(Activity.java:3534)
09-23 14:03:21.527: E/AndroidRuntime(2464): at com.example.radiosu.Principal.entrarOnClick(Principal.java:32)
09-23 14:03:21.527: E/AndroidRuntime(2464): ... 14 more
Menu.class
? Está a apontar para android.view.Menu em vez da sua class Menu. Em vez de usarMenu.class
experimente usarcom.seupackage.Menu.class