I haven't drawn anything yet in Android, but what's clear in the code is that bitmap isn't attached to anything.Try first to paint in an image (add it in the xml layout), and then paint before you execute the setcontentview().

MrSnowflake wrote:I didn't know that, but I always did that, so I thought it was mandatory...

I'm not 100% sure, but I think it still worker, when I accidentially removed it

xplosive wrote:Thanx for the replies, but i still have some questions

When i want to draw something, is it always necessary to create a class in a class? And why does the class in the class extend View? Can you only draw in a View class?

And does someone has the answer to the enum question:

What are the meanings of the Config enum? Config.ARGB_8888, Config.ARGB_4444, Config.ALPHA_8 and Config.RGB_565

Thnx again

No, you can also make a TopLevelClass (no Inner Class), but you have to extend View, which is the baseclass of everything you can see on whole Android.

I'm not 100% sure about the Bitmap.Configs, but as far as I know the numbers behind indicate the numebr of bits used for each channel. So for example Config.ARGB_8888 would use 8 bits for each RGB-Color and 8 bits for transparency.Thanks for asking that, I never thought about that before... it might save me a couple of memory-bytes

I'm doing something like that at the momen. I made a layout with an empty LinearLayout with an id set (layMain) and android:gravity="center". In the application you should layMain=(LinearLayout)findViewById(layMain) and then layMain.addView(yourView);