title: EditText editing Box
body: <p>I want to give user options to make text style like in
  this image in edittext (option for bold italic and Normal).First User select the text then on clicking  button changing the textStyle of text written in EditText.
  : 
  <a href="https://i.stack.imgur.com/Sraeu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sraeu.png" alt="enter image description here"></a></p>
  
  <p>This is code</p>
  
  <pre><code>public class Addnew extends Activity {
  Spinner spinner;
  String select=null;
  private String selec(String selected){
      return selected;
  
  }
  
      @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.addnew);
      spinner = (Spinner) findViewById(R.id.comptypeinput);
      ArrayAdapter&lt;CharSequence&gt; spin= ArrayAdapter.createFromResource(Addnew.this,R.array.spinner,android.R.layout.simple_spinner_item);
      spin.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
      spinner.setAdapter(spin);
  
      spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
  
          String selected = null;
          @Override
          public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                  long arg3) {
              selected = arg0.getItemAtPosition(arg2).toString();
              select = selec(selected);
          }
  
          @Override
          public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
              Toast.makeText(Addnew.this, "Please Select Complaint Type", Toast.LENGTH_LONG).show();
          }
      });
  
  
      Button submit = (Button) findViewById(R.id.insert);
      submit.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
  
              EditText comptimee= (EditText) findViewById(R.id.timeinput);
              EditText compaddresse= (EditText) findViewById(R.id.addressinput);
              EditText compdesce = (EditText) findViewById(R.id.descriptioninput);
              String username= getIntent().getStringExtra("user");
              String comptime = comptimee.getText().toString();
              String compaddress = compaddresse.getText().toString();
              String compdesc = compdesce.getText().toString();
              AddnewAsync as=new AddnewAsync();
              as.execute(select,comptime,compdesc,compaddress,username);
          }
      });
  }
  
  private class AddnewAsync extends AsyncTask&lt;String, Void, String&gt;{
      private Dialog pd ;
      @Override
      protected String doInBackground(String... params) {
          List&lt;NameValuePair&gt; nvp = new ArrayList&lt;NameValuePair&gt;();
          nvp.add(new BasicNameValuePair("comp_type", params[0]));
          nvp.add(new BasicNameValuePair("availtime", params[1]));
          nvp.add(new BasicNameValuePair("description", params[2]));
          nvp.add(new BasicNameValuePair("address", params[3]));
          nvp.add(new BasicNameValuePair("username", params[4]));
          HttpClient hc = new DefaultHttpClient();
          HttpPost hp = new HttpPost("http://172.31.144.231/test/andcompinsert.php");
          StringBuilder sb = new StringBuilder();
          String result=null;
          try {
              hp.setEntity(new UrlEncodedFormEntity(nvp));
              HttpResponse response = hc.execute(hp);
              HttpEntity ent= response.getEntity();
              InputStream is = ent.getContent();
              BufferedReader reader = new BufferedReader(new InputStreamReader(is));
              String line = null;
              while((line=reader.readLine())!= null){
                  sb.append(line+"\n");
              }
               result = sb.toString();
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return result;
      }
      @Override
      protected void onPreExecute() {
          pd = ProgressDialog.show(Addnew.this, "Please Wait", "Uploading");
          super.onPreExecute();
      }
      @Override
      protected void onPostExecute(String result) {
          pd.dismiss();
          String s = result.trim();
          if(s.equals("success")){
              Toast.makeText(Addnew.this, "Updated Successfully", Toast.LENGTH_LONG).show();
              Intent inten = new Intent(Addnew.this,PreviousComp.class);
              String username= getIntent().getStringExtra("user");
              inten.putExtra("user", username);
              startActivity(inten);
          }else{
              Toast.makeText(Addnew.this, "Error Updating... Please Try Again...", Toast.LENGTH_LONG).show();
          }
          super.onPostExecute(result);
      }
  }
  }
  </code></pre>
  
  <p>In my edittext compdesce i want that options.</p>