Merge pull request '修了一个bug' (#4) from dingzijian_branch into develop

pull/6/head
pz4kybsvg 3 years ago
commit a995accef7

@ -172,17 +172,22 @@ public class NotesListActivity extends AppCompatActivity implements OnClickListe
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(layout.note_list); setContentView(layout.note_list);
Drawable drawable= getResources().getDrawable(list_background); SharedPreferences sharedPreferences=getSharedPreferences("data1", Context.MODE_WORLD_READABLE);
BitmapDrawable bd = (BitmapDrawable) drawable; if(!sharedPreferences.contains("DEFAULT"))
Bitmap b = bd.getBitmap(); {
File path = new File(getCacheDir() + "/SampleCropImage.jpeg"); Drawable drawable= getResources().getDrawable(list_background);
try { BitmapDrawable bd = (BitmapDrawable) drawable;
OutputStream os = new FileOutputStream(path); Bitmap b = bd.getBitmap();
b.compress(Bitmap.CompressFormat.JPEG, 100, os); File path = new File(getCacheDir() + "/SampleCropImage.jpeg");
os.close(); try {
} catch (Exception ignored) { OutputStream os = new FileOutputStream(path);
b.compress(Bitmap.CompressFormat.JPEG, 100, os);
os.close();
} catch (Exception ignored) {
}
} }
initResources(); initResources();
/** /**

Loading…
Cancel
Save