1. Trang chủ
  2. » Công Nghệ Thông Tin

android development introduction chương 14 android persistency preferences

25 169 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 25
Dung lượng 514,88 KB

Nội dung

  14    !" #$%&&'(%&&)*+!!" ,-).'(&()'/0.'&(&() 1  233""34" % /5"6 -# % 7### /" + %" 8+ 9" + 5" 7 " 233""3#333(#" 9 /5"6 -# 9  :#;: ;<7=#>" ?  233""3#333(#" 5 /5"6 -# 5 7:4 :@#content providers" +     A /5"6  A Preferences#7#: < +  :#:::" BCD #:" 77" 0 /5"6  0 Using Preferences API calls E,  1. getPreferences()7:+:; 2. getSharedPreferences()7::( 3. getDefaultSharedPreferences()+! +# 7 77 . /5"6  . Using Preferences API calls #FG77"""# """#" """HI$%&'(J Preference Container K L EDITOR """   #  """          ' /5"6  ' Example /" ,4(!G:",<++ +";:> %" #M'')N(4" 9" O +#:#!G" 5" *(4+;!" Warning  PQ;#:",- 4:#:Q(" )) /5"6  ) Example2: -#3R#-BG#S," ,:S,7 3" ,### S,"P#Q +P#Q" -G !*++, /&/& /5"6  /& Example2: -#3R#-BG S#-4Q" B--(*- T!;" ,#; <#;>" [...].. .14 Android – Preferences Preferences Example2: Saving/Retrieving a SharedPreference Object . cis493 .preferences; import java.util.Date; import android. app.Activity; import android. content.SharedPreferences; import android. graphics.Color; import android. graphics.Typeface; import android. os.Bundle; import. "MyPreferences_001"; // create a reference to the shared preferences object SharedPreferences mySharedPreferences; // obtain an editor to add data to my SharedPreferences object SharedPreferences.Editor. the shared preferences object mySharedPreferences = getSharedPreferences(MYPREFS, 0); myEditor = mySharedPreferences.edit(); // has a Preferences file been already created? if (mySharedPreferences

Ngày đăng: 23/10/2014, 08:56

TỪ KHÓA LIÊN QUAN