# How To Build A Todo List In Kotlin Part 4: Storing Items

DevFeed: [How To Build A Todo List In Kotlin Part 4: Storing Items](<https://devfeed.tech/articles/how-to-build-a-todo-list-in-kotlin-part-4-storing-items-22814.md>)

Original publisher: [Read original article](<http://androidessence.com/how-to-build-a-todo-list-in-kotlin-part-4-storing-items/>)

Author: Adam McNeilly

Published: 2017-05-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [data](<https://devfeed.tech/topics/data.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [app](<https://devfeed.tech/tags/app.md>), [code](<https://devfeed.tech/tags/code.md>), [data](<https://devfeed.tech/tags/data.md>), [elvis-operator](<https://devfeed.tech/tags/elvis-operator.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [streams](<https://devfeed.tech/tags/streams.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

## AI overview

A Kotlin tutorial explains how to persist items in an Android todo list application by writing tasks to a text file and reading them back. It also discusses updating storage during activity lifecycle events and briefly explains Kotlin streams, smart casts, and the elvis operator.

## Source excerpt

If you've been following along with parts 1-3, you now have an (almost) working todo list application. The only thing we are missing is persisting the data. Running your Android app now and rotating your screen will show you that the items you add won't persist, and disappear anytime an activity is killed and recreated. This post will show you how to write the list to a text file and read from it.