2014-07-18 72 views
0

我正在開發一個大學的android應用程序。我在我的應用的某些活動中提到了一個電子郵件ID。我希望用戶在點擊此電子郵件ID時發送郵件,因爲我們通過使用mailto功能使用HTML。我搜索了所有可能的方法,但無法獲得與我的要求相關的解決方案。這是我的代碼的一小部分。如何在點擊電子郵件ID時啓用發送電子郵件?

<TextView 
android:id="@+id/textView6" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_alignLeft="@+id/textView5" 
android:layout_below="@+id/textView5" 
android:inputType="textEmailAddress" 
android:text="[email protected]" /> 

是否有任何可能的方法來實現這一點。請任何人指導我。

在此先感謝。

回答

0

添加android:autoLink="email"TextView

<TextView 
    android:id="@+id/textView6" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/textView5" 
    android:layout_below="@+id/textView5" 
    android:autoLink="email" 
    android:inputType="textEmailAddress" 
    android:text="[email protected]" /> 
+0

大:)感謝很多Apoorv。你做了我的一天。 – Web

+0

不客氣。如果它有幫助,你可以接受答案。 – Apoorv

+0

肯定會做。祝你有美好的一天。 – Web

相關問題