- Android Wear Projects
- Ashok Kumar S
- 55字
- 2021-07-15 17:17:57
Saving notes
The saving note method accepts two arguments, Note and Context. When a note is not empty, it opens up the SharedPreference editor and saves the data:
public static void saveNote(Note note, Context context) { if (note != null) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(note.getId(), note.getNotes()); editor.apply(); } }
推薦閱讀
- 演進式架構(原書第2版)
- UML和模式應用(原書第3版)
- Windows系統管理與服務配置
- Xcode 7 Essentials(Second Edition)
- Ext JS Data-driven Application Design
- Java開發入行真功夫
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- Mastering ServiceNow(Second Edition)
- NoSQL數據庫原理
- Mastering Python Design Patterns
- Rust游戲開發實戰
- Python 3 數據分析與機器學習實戰
- Struts 2.x權威指南
- INSTANT Premium Drupal Themes
- INSTANT EaselJS Starter