2011-09-26 17 views

उत्तर

15

सरल। बस अपने टेक्स्ट व्यू में लिंक डालें।

<TextView 
    android:id="@+id/txtLink" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/about_link" 
    android:autoLink="all" /> 

नोट: यहां सबसे महत्वपूर्ण संपत्ति android:autoLink="all" है। यह आपको यूआरएल, ईमेल और फोन नंबर से लिंक करने की अनुमति देता है।

अपना strings.xml में लिंक जोड़ने:

<string name="about_link"><a href='http://example.com'>http://example.com</a></string> 
<string name="about_email"><a href='mailto:[email protected]'>[email protected]</a></string> 

मैं जानता हूँ कि क्या यह उत्तर वास्तव में देर से आ रहा है, लेकिन आशा है कि यह किसी और के साथ आ रहा है मदद करता है।

3
Uri uri = Uri.parse("http://www.example.com"); 
Intent intent = new Intent(Intent.ACTION_VIEW, uri); 
startActivity(intent); 
+0

प्रश्न में क्या पूछा गया था इसके करीब भी नहीं –

संबंधित मुद्दे