I use Android Studio. I want to write colorful text like in the photo below in the same EditText
. I have researched but I have found nothing. Can anyone help me?
The sample output is below.
This is my code: anaM_LV_BG_text
is a list view
name_title
and content are edittext
renk_koduları_string_text
is an array that includes html colors
private void registerClickCallBack_text() {
anaM_LV_BG_renk_text.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(DisplayNote.this, position + 1 + " . seçildi", Toast.LENGTH_SHORT).show();
name_title.setTextColor(Color.parseColor(renk_koduları_string_text[position]));
content.setTextColor(Color.parseColor(renk_koduları_string_text[position]));
SharedPreferences preferences_text = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor_text = preferences_text.edit();
String color_text= renk_koduları_string_text[position];
editor_text.putString("MyColorText",color_text);
editor_text.commit();
}
});
}