Pour créer un message personnalisé qui affiche une image et du texte, utilisez ce code Java.
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.toast_layout, (ViewGroup) findViewById(R.id.toast_layout_root));
TextView text = (TextView) layout.findViewById(R.id.text);
text.setText(content);
ImageView image = (ImageView) layout.findViewById(R.id.image);
image.setImageBitmap(bmImg);
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
et ce fichier de mise en page
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toast_layout_root"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:background="#DAAA"
>
<ImageView android:id="@+id/image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="#FFF"
/>
</LinearLayout>
Je ne comprends pas très bien ce que vous voulez faire. Vous pouvez enregistrer un onclicklistener sur un point de votre carte, puis l'afficher dans un message toast. Vous pouvez également ajouter des images au message toast. Je pourrais donner quelques exemples si vous spécifiez un peu votre problème. – Janusz