I have been debugging this issue for the past 6 hours and have simplified my issue to the most simple case (taking out the bulk of my logic). I am trying to stack 2 (chickens) images on top of each other in a view.
I have followed numerous examples including the last answer to : Draw multiple bitmap on a view in android
My activity looks like:
public class FinalDisplay extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_final_display);
LinearLayout layout = (LinearLayout) findViewById(R.id.activity_final_display);
ImageView iv = new ImageView(this);
iv.setBackgroundResource(R.drawable.images);
layout.addView(iv);
ImageView iv2 = new ImageView(this);
iv.setBackgroundResource(R.drawable.images);
layout.addView(iv2);
}
R.drawable.images is an image of a chicken I took from the Internet and placed in my drawable folder.
http://images3.wikia.nocookie.net/__cb20130606165308/animalcrossing/images/4/41/Chicken.jpg
My xml page looks like
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_final_display"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".FinalDisplay" >
However, only one chicken appears. Any help would be very much appreciated.