I try to change the image on 15 ImageViews
on the same time in my Android app with the setImageResource()
method, but I either get this error message: I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
. Or the app crashes.
Here is the XML code of how I set up the ImageViews
:
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
app:srcCompat="@drawable/logo"
android:id="@+id/logo1" />
And here is how I setup the ImageViews
and change their image:
private ImageView logo1;
private ImageView logo2;
...
private ImageView logo15;
logo1 = (ImageView) findViewById(R.id.logo1);
logo2...
...
logo15 = (ImageView) findViewById(R.id.logo15);
logo1.setImageResource(R.drawable.newLogo1);
logo2...
...
logo15.setImageResource(R.drawable.newLogo15);
If I were to only change the image for one ImageView
the app works fine, but when I change 15 at the same time the app crashes..