Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android java shared preferences

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    tools:ignore="HardcodedText">
  
    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="32dp"
        android:text="Shared Preferences Demo"
        android:textColor="@android:color/black"
        android:textSize="24sp" />
  
    <!--EditText to take the data from the user 
        and save the data in SharedPreferences-->
    <EditText
        android:id="@+id/edit1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textview"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:hint="Enter your Name"
        android:padding="10dp" />
  
    <!--EditText to take the data from the user and
         save the data in SharedPreferences-->
    <EditText
        android:id="@+id/edit2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/edit1"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:hint="Enter your Age"
        android:padding="10dp" 
        android:inputType="number" />
  
</RelativeLayout>
Comment

PREVIOUS NEXT
Code Example
Java :: with uses in python 
Java :: java arraylist copy 
Java :: jsf prefix tag 
Java :: implement hashmap 
Java :: nbubble sort java 
Java :: bukkit shutdown 
Java :: selenium code for login 
Java :: java.lang.stackoverflowerror null onetomany 
Java :: lauch app from brodcast reciever 
Java :: 710*12 
Java :: java regex check if group exists 
Java :: Meditation for stress and depression 
Java :: Not allowed to bind to service Intent 
Java :: Returning an Array from a Method 
Java :: has places api got deprecated??? 
Java :: how to change default size kafka 
Java :: make pattern for V in jaca 
Java :: springboot getting body value 
Java :: remove minimum element from stack java 
Java :: kano magic wand 
Java :: similar thing as pair in c++ in java 
Java :: using automapper without dependency injection 
Java :: Java Creating strings using the new keyword 
Java :: java equivalent of pythons getattr 
Java :: timer tick java 
Java :: sudoku 6x6 java 
Java :: max head java 
Java :: how to romve a element from arraylist in java 
Java :: Calling constructor methods in java 
Java :: how to make a ordering system in microsoft visual basic 2010 express console application 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =