Why does BitmapFactory.decodeByteArray return null?
<p>It's the simple code and instead of getting result to set the Bitmap, I get null. Can anyone tell me where I am making a mistake?</p>

<pre><code>String test = "test";
byte[] byteA = test.getBytes();
Bitmap bmp = BitmapFactory.decodeByteArray(byteA, 0, byteA.length); //&lt;- I get null here
ImageView image = (ImageView) findViewById(R.id.image);
image.setImageBitmap(bmp);
</code></pre>

<p><strong>UPDATE</strong></p>

<p>Ok, so I cannot convert text to image like I thought I could. How about this way? Will this create a bitmap? </p>

<pre><code>  Paint paint = new Paint();
    paint.setStyle(Paint.Style.FILL);
    paint.setColor(Color.RED);
    paint.setTextSize(16);
    paint.setAntiAlias(true);
    paint.setTypeface(Typeface.MONOSPACE);

    Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ALPHA_8);
    float x = bm.getWidth();
    float y = bm.getHeight();
    Canvas c = new Canvas(bm);
    c.drawText("Test", x, y, paint);
</code></pre>
