login mit php/mysql

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
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);
       }
}
 
auch wenn hier meine vorgehensweise kritisiert wird, ich komme weit aus besser voran als ihr glaubt ;)

ich habe nun eine weitere frage analog zum dem Tutorial.

Meine Activity macht gerade folgendes:
auf ButtonClick wird ein Barcode eingelesen, dieser wird in einer php-mysql-abfrage verwendet. es kommt der richtige wert raus.

Analog zur SinginActivity rufe ich die GetDataActivity innerhalb meiner Hauptactivity auf.

in der SinginActivity
Code:
protected void onPostExecute(String result){     
        }
wird der Rückgabewert verwendbar.

ich brauche den Rückgabewert in der "Hauptactivity".
Wie übergebe ich den wert ohne eine neue Actitivy zu starten?

danke
 
Wenn du es schmutzig machen willst, nimm ein Singleton.
 
und wie mache ich es sauber?
 

Ähnliche Themen

B
Antworten
0
Aufrufe
693
basementmedia
B
F
Antworten
0
Aufrufe
839
FlorianAlfredo
F
4
Antworten
0
Aufrufe
562
469110
4
Zurück
Oben Unten