Bonsoir à tous!
Dans mon App lorsque je clique sur le bouton Login,il ne se passe rien,voici mes codes :
Class Loginet le log Cat:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 public class login extends AppCompatActivity { DatabaseHelper myDb; EditText TextPseudo,Textphone; Button b_Login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); TextPseudo=(EditText)findViewById(R.id.editTextPseudo) ; Textphone=(EditText)findViewById(R.id.input_phone); b_Login=(Button)findViewById(R.id.buttonLogin); } public void viewAll() { b_Login.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { myDb.getData(); startActivity(new Intent(getApplicationContext(),Menu.class)); } } ); }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 09-25 15:51:13.551 10156-10156/com.example.sofari.tiffanezni E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.sofari.tiffanezni, PID: 10156 java.lang.IllegalStateException: Could not find method onClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'buttonLogin' at android.view.View$DeclaredOnClickListener.resolveMethod(View.java:4757) at android.view.View$DeclaredOnClickListener.onClick(View.java:4716) at android.view.View.performClick(View.java:5637) at android.view.View$PerformClick.run(View.java:22429) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
quelqu'un peut il m'aider,merci!
Partager