Z
zauber3r
Erfahrenes Mitglied
- 23
- Themenstarter
- #21
danke, hab es so hinbekommen.
ist es richtig das ich für jede neuen bildschirm eine neue activity anlege?
hab gelesen eine aktion = eine activity.
lege mir deshalb neue activities an für jedes "aktionsmenü"
der wechsel in die zweite activity klappt tadellos.
nun möchte ich von der zweiten in die dritte wechseln.
aber es kommt
hier der wechsel in die nächste activity
AuswahlActivity.class
ist es richtig das ich für jede neuen bildschirm eine neue activity anlege?
hab gelesen eine aktion = eine activity.
lege mir deshalb neue activities an für jedes "aktionsmenü"
der wechsel in die zweite activity klappt tadellos.
nun möchte ich von der zweiten in die dritte wechseln.
aber es kommt
Code:
07-20 19:45:51.950: E/AndroidRuntime(1647): FATAL EXCEPTION: main
07-20 19:45:51.950: E/AndroidRuntime(1647): java.lang.IllegalStateException: Could not execute method of the activity
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.view.View$1.onClick(View.java:3044)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.view.View.performClick(View.java:3511)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.view.View$PerformClick.run(View.java:14105)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.os.Handler.handleCallback(Handler.java:605)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.os.Handler.dispatchMessage(Handler.java:92)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.os.Looper.loop(Looper.java:137)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.app.ActivityThread.main(ActivityThread.java:4424)
07-20 19:45:51.950: E/AndroidRuntime(1647): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 19:45:51.950: E/AndroidRuntime(1647): at java.lang.reflect.Method.invoke(Method.java:511)
07-20 19:45:51.950: E/AndroidRuntime(1647): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-20 19:45:51.950: E/AndroidRuntime(1647): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-20 19:45:51.950: E/AndroidRuntime(1647): at dalvik.system.NativeStart.main(Native Method)
07-20 19:45:51.950: E/AndroidRuntime(1647): Caused by: java.lang.reflect.InvocationTargetException
07-20 19:45:51.950: E/AndroidRuntime(1647): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 19:45:51.950: E/AndroidRuntime(1647): at java.lang.reflect.Method.invoke(Method.java:511)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.view.View$1.onClick(View.java:3039)
07-20 19:45:51.950: E/AndroidRuntime(1647): ... 11 more
07-20 19:45:51.950: E/AndroidRuntime(1647): Caused by: java.lang.NullPointerException
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.content.ComponentName.<init>(ComponentName.java:75)
07-20 19:45:51.950: E/AndroidRuntime(1647): at android.content.Intent.<init>(Intent.java:3122)
07-20 19:45:51.950: E/AndroidRuntime(1647): at com.example.phpmysql.KstmenuActivity.onClickAuswahl(KstmenuActivity.java:169)
07-20 19:45:51.950: E/AndroidRuntime(1647): ... 14 more
hier der wechsel in die nächste activity
Code:
Intent nextScreen = new Intent(context, AuswahlActivity.class);
//Intent starten und zur dritten Activity wechseln
context.startActivity(nextScreen);
AuswahlActivity.class
Code:
package com.example.phpmysql;
import android.os.Bundle;
import android.widget.EditText;
public class AuswahlActivity extends KstmenuActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auswahl);
}
}