I am trying to set a image like background image in a layout (by xml or by code)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_layout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/my_image">
or
View myLayout= findViewById( R.id.main_layout);
myLayout.setBackgroundResource(R.drawable.my_image);
My problem is than android fix the image in the all background screen, resizing and modifying the image ratio.
How can I set a image, and that the image takes only the neccesary space? (without image resizing)