क्यों TextView
हाइपरलिंक काम नहीं कर रहा है।टेक्स्ट व्यू हाइपरलिंक काम नहीं कर रहा है?
कस्टम dialog box
के अंदर हाइपरलिंक का उपयोग करना।
हाइपरलिंक प्रकट नहीं होता है।
जहां मैं गलत हूं। इसे कैसे हल करें। मुझे मार्गदर्शन दो।
XML कोड
<TextView
android:id="@+id/google_Link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="10dip"
android:textSize="20dip"
android:linksClickable="true"
android:autoLink="all"
android:textColorLink="#306EFF"
android:text="" />
एंड्रॉयड कोड
TextView googleLink = (TextView) layout.findViewById(R.id.google_Link);
googleLink.setClickable(true);
googleLink.setMovementMethod(LinkMovementMethod.getInstance());
googleLink.setText(Html.fromHtml("<a href=`http://www.google.co.in`>Google</a>"));
एंड्रॉयड प्रकट कोड पहले से
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
धन्यवाद है है।
बैकटिक स्ट्रिंग सीमांकक के लिए HTML में इस्तेमाल नहीं कर रहे हैं। उद्धृत स्ट्रिंग के अंदर उद्धरण चिह्नों को एम्बेड करने के लिए जावा में '\" 'का प्रयोग करें। मैं 'setClickable()' और 'setMovementMethod()' से भी छुटकारा पाउंगा, क्योंकि उन्हें आपके प्रस्तावित 'टेक्स्ट व्यू' सामग्री द्वारा संभाला जाना चाहिए। – CommonsWare