I have converted the selected text in my edittext to bold, Italic and now when i am storing it to sqllite DB it is not getting store in bold or italic form.
When i am retrieving the text it comes in normal form to textview (not in bold).
i have tried adding < b> before and after spannable but it is not working.
bold.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//typeFaceSelected = Typeface.BOLD;
int startSelection = frontedit.getSelectionStart();
int endSelection = frontedit.getSelectionEnd();
if(startSelection>endSelection){
startSelection = frontedit.getSelectionEnd();
endSelection = frontedit.getSelectionStart();
}
Spannable s = frontedit.getText();
s.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), startSelection, endSelection, 0);
frontedit.setText(s);
frontedit.setSelection(startSelection, endSelection);
}
});
i dont know how to implement with html the bold, italic and normal font in edittext for selected text which will get store in sqllite DB and can be retrieved in same format (bold, italic). (if someone have code for this and share will be helpful)
Or
if someone is aware of how to store in sqllite db using spannable please help on above.