From 338ed8affc43ae36b54d1f8e6729ed1ec1aa7490 Mon Sep 17 00:00:00 2001 From: Dingzijian <1418626018@qq.com> Date: Fri, 21 Oct 2022 20:41:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E4=BA=86=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../micode/notes/ui/NotesListActivity.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Notes-master/java/net/micode/notes/ui/NotesListActivity.java b/src/Notes-master/java/net/micode/notes/ui/NotesListActivity.java index 7e0075e..60c6fff 100644 --- a/src/Notes-master/java/net/micode/notes/ui/NotesListActivity.java +++ b/src/Notes-master/java/net/micode/notes/ui/NotesListActivity.java @@ -172,17 +172,22 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe super.onCreate(savedInstanceState); setContentView(layout.note_list); - Drawable drawable= getResources().getDrawable(list_background); - BitmapDrawable bd = (BitmapDrawable) drawable; - Bitmap b = bd.getBitmap(); - File path = new File(getCacheDir() + "/SampleCropImage.jpeg"); - try { - OutputStream os = new FileOutputStream(path); - b.compress(Bitmap.CompressFormat.JPEG, 100, os); - os.close(); - } catch (Exception ignored) { + SharedPreferences sharedPreferences=getSharedPreferences("data1", Context.MODE_WORLD_READABLE); + if(!sharedPreferences.contains("DEFAULT")) + { + Drawable drawable= getResources().getDrawable(list_background); + BitmapDrawable bd = (BitmapDrawable) drawable; + Bitmap b = bd.getBitmap(); + File path = new File(getCacheDir() + "/SampleCropImage.jpeg"); + try { + OutputStream os = new FileOutputStream(path); + b.compress(Bitmap.CompressFormat.JPEG, 100, os); + os.close(); + } catch (Exception ignored) { + } } + initResources(); /** -- 2.34.1