bonjour,
je suis r-i-d-i-c-u-l-e car je n'arrive pas à trouver mon erreur toute bête, ça doit être une sacrée coquille.
j'ai pourtant relu et fait un clean project, et non, j'ai toujours mon erreur :
alors que j'ai si peu de code :error: cannot find symbol variable tvHello
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 package abbe2017.fr.helloandroid; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tvHello = (TextView) findViewById(R.id.textView); } public void helloToYou (View view) { tvHello.setText("où est ma coquille"); } }Je suis sûr que ça doit être stupide comme erreur....
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 <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="abbe2017.fr.helloandroid.MainActivity"> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="coucoubouton" tools:layout_editor_absoluteX="194dp" tools:layout_editor_absoluteY="360dp" /> </android.support.constraint.ConstraintLayout>
Partager