I want to create images which will go down from the upper part of the screen.
For up to today I have this:
ImageView mario = (ImageView) findViewById
Using following code you can add image dynamically
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView imageview = new ImageView(MainActivity.this);
RelativeLayout relativelayout = (RelativeLayout)findViewById(R.id.relativeLayout);
LinearLayout.LayoutParams params = new LinearLayout
.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
// Add image path from drawable folder.
imageview.setImageResource(R.drawable.demo_new_image);
imageview.setLayoutParams(params);
relativelayout.addView(imageview);
}
}