I'm trying to load a simple resource from my drawable. I created a bitmap which has a drawable as a source:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center"
android:src="@drawable/ball"/>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#FF0000"/>
</shape>
I'm loading using this code:
bitmapDrawable = BitmapFactory.decodeResource( context.getResources(),
R.drawable.bitmap_ball );
But they always return null. If bitmap xml exists and drawable too, what is the reason to this returns null?