Guest User

Untitled

a guest
Dec 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <TextView
  2. android:id="@+id/tv_linkifydate"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:layout_alignParentTop="true"
  6. android:layout_alignParentLeft="true"
  7. android:textSize="14sp"
  8. android:autoLink="email" />
  9.  
  10. //set link to email and this works.
  11. tvBody.setText(date_in_body[0]);
  12. tvLinkifyDate.setVisibility(View.VISIBLE);
  13. tvLinkifyDate.setText("name@adrress.com");
  14.  
  15. <TextView
  16. android:id="@+id/tv_linkifydate"
  17. android:layout_width="wrap_content"
  18. android:layout_height="wrap_content"
  19. android:layout_alignParentTop="true"
  20. android:layout_alignParentLeft="true"
  21. android:textSize="14sp"
  22. android:autoLink="all" />
  23.  
  24. tvBody.setText(date_in_body[0]);
  25. tvLinkifyDate.setVisibility(View.VISIBLE);
  26. tvLinkifyDate.setText(date_in_body[1]);
  27.  
  28. Pattern pattern = Pattern.compile("yyyy-MM-dd hh:mm:ss");
  29. String scheme = "yyyy-MM-dd hh:mm:ss";
  30. Linkify.addLinks(tvLinkifyDate,pattern,scheme);
Add Comment
Please, Sign In to add comment