Code example for UnderlineSpan

0
    		mNote = new Note(cursor);
    		 
    		mSpanText.clear();
    		mSpanText.append(mNote.getTitle() + "\n" + mNote.getContent());
    		mSpanText.setSpan(new StyleSpan(Typeface.BOLD), 0, mNote.getTitle().length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
    		mSpanText.setSpan(new UnderlineSpan(), 0, mNote.getTitle().length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        	mNoteEdit.setText(mSpanText, BufferType.SPANNABLE);
 
            cursor.close();
            mNotesDb.close();
		} else { 
			mNote = new Note();
		} 
	} 
	 
	private void saveNote() { 
		if (mModified) {
			Spanned content = mNoteEdit.getText();
			 
			if (content.length() > 0) {
Experience pair programming with AI  Get Codota for Java