Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. <DigitalClock
  2. android:id="@+id/digitalClock1"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:layout_alignParentRight="true"
  6. android:layout_alignParentTop="true"
  7. android:layout_marginRight="28dp"
  8. android:layout_marginTop="28dp"
  9. android:text="DigitalClock"
  10. android:textColor="#FA8072"
  11. android:textSize="40dp" />
  12.  
  13. <TextView
  14. android:id="@+id/textView1"
  15. android:layout_width="wrap_content"
  16. android:layout_height="wrap_content"
  17. android:layout_below="@+id/digitalClock1"
  18. android:layout_toLeftOf="@+id/digitalClock1"
  19. android:text="MEDICINES"
  20. android:textColor="#228B22"
  21. android:textAppearance="?android:attr/textAppearanceMedium"
  22. android:textSize="20dp" />
  23.  
  24. <EditText
  25. android:id="@+id/editText1"
  26. android:layout_width="wrap_content"
  27. android:layout_height="wrap_content"
  28. android:layout_alignLeft="@+id/textView1"
  29. android:layout_below="@+id/textView1"
  30. android:layout_marginTop="39dp"
  31. android:ems="10" />
  32.  
  33. <TextView
  34. android:id="@+id/textView2"
  35. android:layout_width="wrap_content"
  36. android:layout_height="wrap_content"
  37. android:layout_alignLeft="@+id/editText1"
  38. android:layout_below="@+id/textView1"
  39. android:layout_marginTop="22dp"
  40. android:text="Name" />
  41.  
  42. <TextView
  43. android:id="@+id/TextView01"
  44. android:layout_width="wrap_content"
  45. android:layout_height="wrap_content"
  46. android:layout_alignLeft="@+id/editText1"
  47. android:layout_below="@+id/editText1"
  48. android:layout_marginTop="8dp"
  49. android:text="Name" />
  50.  
  51. <EditText
  52. android:id="@+id/EditText01"
  53. android:layout_width="wrap_content"
  54. android:layout_height="wrap_content"
  55. android:layout_alignLeft="@+id/TextView01"
  56. android:layout_centerVertical="true"
  57. android:layout_marginTop="8dp"
  58. android:ems="10" />
  59.  
  60. public PagesFragment(){}
  61.  
  62. @Override
  63. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  64. Bundle savedInstanceState) {
  65.  
  66. View rootView = inflater.inflate(R.layout.fragment_pages, container, false);
  67.  
  68. return rootView;
  69. }
  70.  
  71. //For storing string value in sharedPreference
  72. SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
  73. SharedPreferences.Editor editor = preferences.edit();
  74. editor.putString("Name","Harneet");
  75. editor.commit();
  76.  
  77. //For retrieving string value from sharedPreference
  78. SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
  79. String name = preferences.getString("Name","");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement