Q:

RelativeLayout to the right instead of on top

How can i make the imageViews land beside eachother and not on top of eachother?
    public void deckButtonOnClick(View v) {
    ImageView imageView = new ImageView(getApplicationContext());
    imageView.setImageResource(DECK.takeCard());
    imageView.setAdjustViewBounds(true);
    imageView.setLayoutParams(PARAMS);
    imageView.setTag("0");
    imageView.setOnClickListener(new MyOnClickListener());

    ((RelativeLayout) findViewById(R.id.innerRelativeLayout)).addView(imageView);

}

Thank you!

A:

Option 1: Rework your container for the cards as a LinearLayout instead of RelativeLayout, using orientation="horizontal".
Option 2: Using the RelativeLayout, you'll need to give each imageView you create an ID (maybe increment a counter each time one is created and append it to the ID). Then, when you are creating your PARAMS variable, you can add a rule to align to the right of the previous ImageView.
PARAMS = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
PARAMS.addRule(RelativeLayout.RIGHT_OF, R.id.imageView1);
imageView.setLayoutParams(PARAMS);

