Which call changes an ImageView's picture to another drawable at run time?

  1. img.text = R.drawable.x
  2. setContentView(R.drawable.x)
  3. img.loadUrl(R.drawable.x)
  4. img.setImageResource(R.drawable.studentsara)
Answer

D) img.setImageResource(R.drawable.studentsara)

setImageResource sets a drawable resource by ID.

Computer Science MCQ · More Lab: Student Information App Using Resources MCQs · Practise