Attempt to write Serializable Object with SAF gives as result an empty file
问题 I want to use SAF to write Object files To write a text files If I try: DocumentFile txtfile=df.createFile("text", "myfile.txt"); Uri source = txtfile.getUri(); resolver = getContentResolver(); OutputStream os = resolver.openOutputStream(source); PrintWriter out = new PrintWriter(new OutputStreamWriter(os)); out.print(somestring); out.flush(); out.close(); the file is correctly created and written. But if I try in a similar way to write a Serializable object rather than a string with this