0

in my android application the user can send feedback

public void c_send_send(View v) {
    Uri uri = Uri.parse("mailto:xx@xx.net");
    Intent send = new Intent(Intent.ACTION_SENDTO, uri);
    send.putExtra(Intent.EXTRA_SUBJECT, "feedback");
    send.putExtra(
            Intent.EXTRA_TEXT,
            DeviceInformation(getResources().getString(R.string.app_name),
                    getResources().getString(R.string.app_version)));
    startActivity(Intent.createChooser(send, "feedback"));
}
public static String DeviceInformation(String app_name, String app_version) {
    String  EnterTextHere = "[Enter Text Here]"; 
    Spannable spanText = Spannable.Factory.getInstance().newSpannable(EnterTextHere);
    spanText.setSpan(new BackgroundColorSpan(0xFFFFFF00), 1, 17, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    String info = "\n" + spanText + "\n\n\n\nDevice Model: "
            + android.os.Build.MANUFACTURER
            + " " + android.os.Build.MODEL + "\nAndroid Version: "
            + Build.VERSION.RELEASE + "\nApplication Version: "
            + app_version;
    return info;
}

the question how can i make

[Enter Your Text Here]

highlighted as shown in the picture posted in the link below

Example

Truck Whale
  • 27
  • 2
  • 8
  • possible duplicate of [Is it possible to have multiple styles inside a TextView?](http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview) – Shayan Pourvatan May 14 '14 at 08:57
  • hey guys please anyone recheck my question i make an edit but there is no change. any help here???? – Truck Whale May 14 '14 at 09:55
  • http://stackoverflow.com/questions/9128297/how-to-dyamically-select-text-from-edittext-onclicklistener this will select your text from a certain index to another index – einschnaehkeee May 14 '14 at 10:12

2 Answers2

1

Spannable strings are a very good way to use different styling in a single string. try exploring its different functions.

Rushil Soin
  • 123
  • 4
  • i'm stuck with spannable strings it's done with text view but in my situation i don't know how to do it will you help me just to begin with it – Truck Whale May 14 '14 at 09:22
  • there is [this](http://stackoverflow.com/questions/4669464/select-all-text-inside-edittext-when-it-gets-focus) option available, but it selects all the text, but you do not want that. So its better if you use the hint and send all the information in the background. That is because if you select some text, then the selection menu (cut-copy-paste) above will be shown, and you would not want that. – Rushil Soin May 14 '14 at 11:11
0

You can make it highlighted by the Toast option in android

Toast.makeText(getApplicationContext(), (String)data.result, Toast.LENGTH_LONG).show();
Shayan Pourvatan
  • 11,898
  • 4
  • 42
  • 63
user3635766
  • 27
  • 1
  • 8