एक कस्टम टोस्ट संदेश बनाने के लिए जो एक छवि दिखाता है और कुछ पाठ इस जावा कोड का उपयोग करते हैं।
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();
और इस लेआउट फ़ाइल
<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>
मैं पूरी तरह से समझ नहीं पा रहा हूं कि आप क्या करना चाहते हैं। आप ऑनक्लिकलिस्टर को मानचित्र ओवरले पर एक बिंदु पर पंजीकृत कर सकते हैं और फिर टोस्ट संदेश में प्रदर्शित कर सकते हैं। आप टोस्ट संदेश में भी छवियां जोड़ सकते हैं। यदि आप अपनी समस्या को थोड़ा सा निर्दिष्ट करते हैं तो मैं कुछ उदाहरण दे सकता हूं। – Janusz