Created
May 27, 2016 09:48
-
-
Save nicegoing/c803332a973b07cb7f280cc3383760b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String user_agree_policy_1 = UIUtil.getString(R.string.user_agree_policy_1); | |
String user_agree_policy_2 = UIUtil.getString(R.string.user_agree_policy_2); | |
String user_agree_policy_3 = UIUtil.getString(R.string.user_agree_policy_3); | |
String text = user_agree_policy_1 + user_agree_policy_2 + user_agree_policy_3; | |
SpannableString spannableString = new SpannableString(text); | |
spannableString.setSpan(new ClickableSpan() { | |
@Override | |
public void onClick(View widget) { | |
Toast.makeText(context,"jump to one page",Toast.LENGTH_LONG); | |
} | |
}, 0, user_agree_policy_1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
spannableString.setSpan(new ClickableSpan() { | |
@Override | |
public void onClick(View widget) { | |
Toast.makeText(context,"jump to two page",Toast.LENGTH_LONG); | |
} | |
}, (user_agree_policy_2 + user_agree_policy_1).length(), text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
tvAgreePolicy.setText(spannableString); | |
tvAgreePolicy.setMovementMethod(LinkMovementMethod.getInstance()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment