linkify

Android - Linkify Problem

跟風遠走 提交于 2019-12-01 17:39:42
问题 I seem to be having trouble with the linkify I am using in my Custom Adapter. For some reason I recieve the following stack track when I click on one of the links: 06-07 20:49:34.696: ERROR/AndroidRuntime(813): Uncaught handler: thread main exiting due to uncaught exception 06-07 20:49:34.745: ERROR/AndroidRuntime(813): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 06-07

Android set autoLink attribute programmatically

假如想象 提交于 2019-12-01 15:51:34
<TextView android:text="123456789" android:autoLink="phone"> </TextView> I want to create this TextView from code, however I am encountering countless problems. In the first place, I got halfway creating a TextView and adding this: tw_phone.setAutoLinkMask(0x04); This resulted in a clickable TextView, but when you clicked, a toast said "No application can perform this action", or something similar. I also tried with Linkify.addLinks(tw_phone, Linkify.PHONE_NUMBERS); //and .ALL but it gave me the same result. When I decided to ask on StackOverflow, I tried to strip my code down incase there

Using Linkify in ListView's ArrayAdapter causes RuntimeException

送分小仙女□ 提交于 2019-12-01 12:39:14
I have a TextView in my ArrayAdapter that may contain some hyperlinks. For those links I use Linkify : public View getView(int position, View convertView, ViewGroup parent) { View rowView = convertView; if (rowView == null) { rowView = inflater.inflate(R.layout.list_item_2, null); holder = new ViewHolder(); holder.content = (TextView) rowView.findViewById(R.id.postContent); holder.date = (TextView) rowView.findViewById(R.id.postDate); rowView.setTag(holder); } else { holder = (ViewHolder) rowView.getTag(); } holder.content.setText(contents.get(position)); holder.date.setText(dates.get(position

Android Linkify links textColor ignored, css style overrides possible?

牧云@^-^@ 提交于 2019-11-30 09:14:15
I am using Linkify in my app, and visited link text is appearing as dark purple. My overall layout background color is dark blue so this is impossible to read. The text is set as white, but visited links are appearing as dark purple. How do I override this? <TextView android:text="Website:" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="14dip" android:paddingBottom="2dip" android:background="#ffffff" android:textColor="#577dbe" /> <TextView android:text="http://www.mysite.com/" android:layout_width="match_parent" android:layout_height="wrap_content"

TextView that is linkified and selectable?

跟風遠走 提交于 2019-11-30 00:06:38
I would like to have a TextView that is both selectable and linkified. When I do both I end up with selectable text but links can't be clicked. EDIT: I'll show the code to explain with what I struggle: TextView textView = view.findViewById(R.id.mytext); textView.setText("My text: +4412345678 Go to website: www.google.com Blah blah"); Linkify.addLinks(textView, Linkify.ALL); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { textView.setTextIsSelectable(true); } Did you try to add this on your TextView xml code? <TextView ... android:autoLink="all" android:textIsSelectable="true" />

Can I change TextView link text after using Linkify?

蓝咒 提交于 2019-11-29 15:18:18
问题 Is is possible to change TextView text after using Linkify to create links? I have something where I want the url to have two fields, a name and id, but then I just want the text to display the name. So I start off with a textview with text that includes both name and id, and linkify to create the appropriate links with both fields. But for the display, I don't want to show the id. Is this possible? 回答1: It's kind of a pain but yes. So Linkify basically does a few things. First it scans the

Android Linkify links textColor ignored, css style overrides possible?

☆樱花仙子☆ 提交于 2019-11-29 14:09:54
问题 I am using Linkify in my app, and visited link text is appearing as dark purple. My overall layout background color is dark blue so this is impossible to read. The text is set as white, but visited links are appearing as dark purple. How do I override this? <TextView android:text="Website:" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="14dip" android:paddingBottom="2dip" android:background="#ffffff" android:textColor="#577dbe" /> <TextView android

Disable the automatic Linkify of Webview

五迷三道 提交于 2019-11-29 10:42:32
I have a webview that I am creating. It seems to automatically be linkifying numbers into tel: urls. I didn't see a way to remove this ability (at least nothing similar to the way to enable it on a textview). The code is pretty simple: // populate the web view WebView webView = (WebView) findViewById(R.id.app_info_webview); webView.getSettings().setJavaScriptEnabled(true); webView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY); webView.setBackgroundColor(0); String url = APP_INFO_BODY_HTML + "?versionName=" + versionName; webView.loadUrl(url); I have a copyright notice at the bottom of

android:autoLink for phone numbers doesn't always work

蹲街弑〆低调 提交于 2019-11-29 01:29:19
I have a simple TextView with local phone number 852112222 or (8 5) 211 2222. I need it to be clickable, so naturally I used android:autoLink="all" . But for some reason I don't understand same phone number is not "linkified" on all devices. On plain Genymotion device it didn't work. On my personal OnePlus2 device it worked. Tested on bunch on different devices - no luck. What could be the issue? User account preferences? Android version? ORM? Something else? Chris Wong Here is my investigation. I created a new project, and added android:autoLink="all" to a text view in activity_main.xml .

TextView that is linkified and selectable?

∥☆過路亽.° 提交于 2019-11-28 21:05:36
问题 I would like to have a TextView that is both selectable and linkified. When I do both I end up with selectable text but links can't be clicked. EDIT: I'll show the code to explain with what I struggle: TextView textView = view.findViewById(R.id.mytext); textView.setText("My text: +4412345678 Go to website: www.google.com Blah blah"); Linkify.addLinks(textView, Linkify.ALL); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { textView.setTextIsSelectable(true); } 回答1: Did you try to