Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DigitalClock
- android:id="@+id/digitalClock1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_marginRight="28dp"
- android:layout_marginTop="28dp"
- android:text="DigitalClock"
- android:textColor="#FA8072"
- android:textSize="40dp" />
- <TextView
- android:id="@+id/textView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/digitalClock1"
- android:layout_toLeftOf="@+id/digitalClock1"
- android:text="MEDICINES"
- android:textColor="#228B22"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="20dp" />
- <EditText
- android:id="@+id/editText1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView1"
- android:layout_below="@+id/textView1"
- android:layout_marginTop="39dp"
- android:ems="10" />
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/editText1"
- android:layout_below="@+id/textView1"
- android:layout_marginTop="22dp"
- android:text="Name" />
- <TextView
- android:id="@+id/TextView01"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/editText1"
- android:layout_below="@+id/editText1"
- android:layout_marginTop="8dp"
- android:text="Name" />
- <EditText
- android:id="@+id/EditText01"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/TextView01"
- android:layout_centerVertical="true"
- android:layout_marginTop="8dp"
- android:ems="10" />
- public PagesFragment(){}
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_pages, container, false);
- return rootView;
- }
- //For storing string value in sharedPreference
- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
- SharedPreferences.Editor editor = preferences.edit();
- editor.putString("Name","Harneet");
- editor.commit();
- //For retrieving string value from sharedPreference
- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
- String name = preferences.getString("Name","");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement