-1

My textview -

TextView doses = (TextView) findViewById(R.id.doses);

int getting code -

int nIndex = cursor.getColumnIndexOrThrow(DictionaryDatabase.KEY_DOSES);

What I want is add some pre defined TEXT like "DOSE:" before nIndex. My expected result will be like-

doses.setText(cursor.getString("DOSE"+nIndex));

How to do that??

Zils
  • 403
  • 2
  • 4
  • 19

1 Answers1

2

Just use this:

doses.setText("DOSE" + cursor.getString(nIndex));
FD_
  • 12,947
  • 4
  • 35
  • 62
  • Great! If i want to add some color like DOSE will be yellow.. how to do that? – Zils Feb 17 '14 at 13:18
  • Have a look at this: http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext – FD_ Feb 17 '14 at 13:20