Bonjour,
J'ai une longue expérience du développement, mais je débute complétement en développement en java sous android.
Voila mon problème actuel (je sais qu'il y en aura d'autres):

Je sais comment intercepter un clic sur un bouton etc, mais j'ai le bout de code ci-dessous, et je voudrais intercepter un clic sur l'animation graphique contenue dans la classe BalleView.

J'ai essayé d'implémenté la même méthode que pour un bouton, mais rien ne marche !
Ci-dessous le début du code présent dans le fichier activity_main.xml. Mon erreur vient-elle de là ?

Merci de vos lumières,
Cordialement,
Bernard

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
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/principal"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/espace"
        android:clickable="true">
        <com.example.bpell.balle.BalleView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="10"
            android:alpha="1"
            android:id="@+id/balle"
            android:background="#C8C8C8"
            android:clickable="true"/>
    </LinearLayout>
    <LinearLayout