 <p>try this</p> <pre><code>def bookList() = { val res = resource.getAssets.open("demo.png") val image = Drawable.createFromStream(res, "demo.png") val map = Map[String, Drawable]() for (i &lt;- 1 to 100) { map += (s"test book$i" -&gt; image) } map } </code></pre>