Code example for SpannableString

Methods: addLinks

0
    public static SpannableString getLinkifiedText(Context context, int textId) {
        return getLinkifiedText(context.getText(textId));
    } 
 
    public static SpannableString getLinkifiedText(CharSequence text) {
        final SpannableString msg = new SpannableString(text);
        Linkify.addLinks(msg, Linkify.ALL);
        return msg;
    } 
 
    /* 
     * confirmation dialogs 
     */ 
 
    public static AlertDialog.Builder buildConfirmationDialog(Context context, int titleId, int msgId) {
        return new AlertDialog.Builder(context)
            .setTitle(titleId)
            .setMessage(getLinkifiedText(context, msgId));
    } 
 
    public static void showConfirmationDialog(Context context, int titleId, int msgId, int positiveBtnTextId) {