Skip to content

Commit e037bcb

Browse files
committed
comments improved
1 parent 92c61f8 commit e037bcb

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

platform/android/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.cgogolin.penandpdf"
4-
android:versionCode="61"
5-
android:versionName="1.3.3+"
4+
android:versionCode="62"
5+
android:versionName="1.3.4"
66
android:installLocation="auto">
77
<permission android:name="com.cgogolin.penandpdf.LAUNCH_PEN_AND_PDF_FILE_CHOOSER" />
88
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

platform/android/src/com/cgogolin/penandpdf/PenAndPDFActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public void destroyAlertWaiter() {
400400
@Override
401401
public void onCreate(Bundle savedInstanceState)
402402
{
403-
//See onSaveInstanceState() for why we do this
403+
//Treat the bundle with the SaveInstanceStateManager before calling through to super
404404
savedInstanceState = SaveInstanceStateManager.recoverBundleIfNecessary(savedInstanceState, getClass().getClassLoader());
405405

406406
super.onCreate(savedInstanceState);
@@ -1976,6 +1976,7 @@ protected void onSaveInstanceState(Bundle outState) { //Called when the app is d
19761976
if(mDocView != null) outState.putParcelable("mDocView", mDocView.onSaveInstanceState());
19771977
outState.putString("latestTextInSearchBox", latestTextInSearchBox);
19781978

1979+
//Treat the bundle with the SaveInstanceStateManager before saving it
19791980
SaveInstanceStateManager.saveBundleIfNecessary(outState);
19801981
}
19811982

platform/android/src/com/cgogolin/penandpdf/SaveInstanceStateManager.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
// Partially taken from https://stackoverflow.com/questions/14256809/save-bundle-to-file
44

5-
/* As the data returned by marshall can not be reliably read under a different
6-
* platform version we add the incremetal version to the file name. Restoring
7-
* then simply yields null.
8-
* see also: https://developer.android.com/reference/android/os/Parcel.html#marshall().
9-
If the bundle is too large, which can happen because it contains the drawing and drawing history
5+
/* If the bundle passed to onSaveInstanceState() is too large, which can happen because here it contains the drawing and drawing history,
106
* the data is lost and under Android N the app hard crashes with a android.os.TransactionTooLargeException,
11-
* therefore we instead save the bundle to a file and restore from there in onResume()*/
7+
* therefore through this handler we instead save the bundle to a file and restore from there in onResume()
8+
* A warning: As the data returned by marshall can not be reliably read under a different
9+
* platforms one shouldn't save a marshaled bundle to permanent storage. Here we are only saving to a temporary file wich is deleted when the VM exits and this should be OK.
10+
* See also: https://developer.android.com/reference/android/os/Parcel.html#marshall(). */
1211

1312
import android.content.Context;
1413
import android.os.Bundle;

0 commit comments

Comments
 (0)