Java 在退出中保存图像和字符串

Java 在退出中保存图像和字符串,java,android,Java,Android,我想在退出应用程序时保存图像列表和字符串列表(当我再次打开应用程序时,我可以对它们进行操作) 我不知道该如何实施它 我只发现我可以用以下方法保存我的详细信息: SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_PRIVATE); SharedPreferences.Editor e = myPrefs.edit(); e.putString("pathreturned", path); e.

我想在退出应用程序时保存图像列表和字符串列表(当我再次打开应用程序时,我可以对它们进行操作)

我不知道该如何实施它

我只发现我可以用以下方法保存我的详细信息:

SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_PRIVATE);

    SharedPreferences.Editor e = myPrefs.edit();
    e.putString("pathreturned", path);
    e.commit(); 
但是我没有找到如何保存列表(位图或字符串)或照片

非常感谢

本文讨论了不要使用SD卡,并建议您将文件作为BLOB保存到SQLite数据库中


或者,突出显示如何将图像保存到SD卡。

您可以这样做,但必须将图像保存在SD卡上,并且可以按如下方式使用它

SharedPreferences mypref = PreferenceManager.getDefaultSharedPreferences(this);
Editor edit=mypref.edit();
edit.putString("imagepath","/sdcard/imagename.jpeg");
edit.commit();