title: Android, SpannableString, ArrayAdapter and Listview
body: <p>i am newbie to android and i got a question for you. I want to add icon to a text in a listview. I'm adding the rows(textview) to listview dynamically with below code. But the text doesnt contain the icon. </p>
  
  <pre><code>.
  .
  .
  btnicon = (Button)findViewById(R.id.button1);
  txt = (TextView)findViewById(R.id.textView1);
  txt.setText("   denemedene",BufferType.SPANNABLE);
  list = (ListView)findViewById(R.id.listview);
  dizi = new ArrayAdapter&lt;String&gt;(this, R.layout.text);
  list.setAdapter(dizi);
  btnicon.setOnClickListener(click);
  .
  .
  .
  private OnClickListener click = new OnClickListener() {
  
      @Override
      public void onClick(View v) {
          if (v == btnicon){
              SpannableString spans = new SpannableString(txt.getText());
              Drawable dra = getResources().getDrawable(R.drawable.p1);
              dra.setBounds(0, 0, dra.getIntrinsicWidth() , dra.getIntrinsicHeight());
              ImageSpan span = new ImageSpan(dra,ImageSpan.ALIGN_BASELINE);
              spans.setSpan(span, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
              dizi.add(spans.toString());
          }
      }
  };
  </code></pre>
  
  <p>it is something about the toString method. Because when i change the </p>
  
  <pre><code>dizi.add(spans.toString());
  </code></pre>
  
  <p>line with </p>
  
  <pre><code>txt.setText(spans,BufferType.SPANNABLE);
  </code></pre>
  
  <p>it works, i can see the icon on text. I have no idea why it is not working with toString() method.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks..</p>