this is my code :
LinearLayout imageViewParent = (LinearLayout) findViewById(R.id.imageViewParent); ImageView view = new ImageView(this); imageViewPa
Use this:
view.setImageResource(R.drawable.np);
You should use setImageResource not setBackgroundResource.