- 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(); } }
推薦閱讀
- Learning NServiceBus(Second Edition)
- C++案例趣學
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- C# 8.0核心技術指南(原書第8版)
- HTML5+CSS3 Web前端開發技術(第2版)
- C語言從入門到精通
- Julia for Data Science
- Instant PHP Web Scraping
- Angular應用程序開發指南
- 計算機應用基礎項目化教程
- Oracle 12c從入門到精通(視頻教學超值版)
- Hands-On Dependency Injection in Go
- 大話代碼架構:項目實戰版
- Hands-On ROS for Robotics Programming
- Learning Apache Thrift