Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kotlin - SharedPreferences
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical"
android:gravity="center_horizontal">
<EditText
android:id="@+id/editName"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Name"
android:layout_marginTop="80dp"/>
<EditText
android:id="@+id/editEmail"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="Email"
android:layout_marginTop="20dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save"
android:layout_marginTop="20dp"
android:onClick="saveData"/>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.