Hello this is my first time using onClick in an xml instead of in code. This is the layout:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/reset"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/reset"
android:scaleType="fitCenter"
android:scaleX="-1"
android:onClick="reset"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/resetIcon" />
</androidx.constraintlayout.widget.ConstraintLayout>
And in the code:
public class SettingsActivity extends AppCompatActivity {
public void reset(View view) {
//Do things
}
}
As the title says, android:onClick gives the warning
Use databinding or explicit wiring of click listener in code
Googling this statement gives no results.