title: Update LazyColumn after API response in Jetpack Compose
body: <p>I am completely new to Jetpack Compose AND Kotlin, but not to Android development in Java. Wanting to make first contact with both technologies, I wanted to make a really simple app which populates a LazyColumn with images from <a href="https://dog.ceo/dog-api/" rel="nofollow noreferrer">Dog API</a>.</p>
  <p>All the Retrofit connection part works OK, as I've managed to populate one card with a random puppy, but when the time comes to populate the list, it's just impossible. This is what happens:</p>
  <ol>
  <li>The interface is created and a white screen is shown.</li>
  <li>The API is called.</li>
  <li>Wait about 20 seconds (there's about 400 images!).</li>
  <li><code>dogImages</code> gets updated automatically.</li>
  <li>The LazyColumn never gets recomposed again so the white screen stays like that.</li>
  </ol>
  <p>Do you have any ideas? I can't find any tutorial on this matter, just vague explanations about state for scroll listening.</p>
  <p>Here's my code:</p>
  <pre><code>class MainActivity : ComponentActivity() {
      private val dogImages = mutableStateListOf&lt;String&gt;()
  
      @ExperimentalCoilApi
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContent {
              PuppyWallpapersTheme {
                  // A surface container using the 'background' color from the theme
                  Surface(color = MaterialTheme.colors.background) {
                      DogList(dogImages)
                      searchByName(&quot;poodle&quot;)
                  }
              }
          }
      }
  
      private fun getRetrofit():Retrofit {
          return Retrofit.Builder()
              .baseUrl(&quot;https://dog.ceo/api/breed/&quot;)
              .addConverterFactory(GsonConverterFactory.create())
              .build()
      }
  
      private fun searchByName(query: String) {
          CoroutineScope(Dispatchers.IO).launch {
              val call = getRetrofit().create(APIService::class.java).getDogsByBreed(&quot;$query/images&quot;)
              val puppies = call.body()
              runOnUiThread {
                  if (call.isSuccessful) {
                      val images = puppies?.images ?: emptyList()
                      dogImages.clear()
                      dogImages.addAll(images)
                  }
              }
          }
      }
  
      @ExperimentalCoilApi
      @Composable
      fun DogList(dogs: SnapshotStateList&lt;String&gt;) {
          LazyColumn() {
              items(dogs) { dog -&gt;
                  DogCard(dog)
              }
          }
      }
  
      @ExperimentalCoilApi
      @Composable
      fun DogCard(dog: String) {
          Card(
              modifier = Modifier
                  .fillMaxWidth()
                  .padding(15.dp),
              elevation = 10.dp
          ) {
              Image(
                  painter = rememberImagePainter(dog),
                  contentDescription = null
              )
          }
      }
  }
  </code></pre>
  <p>Thank you in advance! :)</p>