Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes mArgs beeing null on recreation of activity #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/android/PhotoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class PhotoActivity extends Activity {
private File mTempImage;
private int shareBtnVisibility;

public static JSONArray mArgs = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -64,6 +62,7 @@ protected void onCreate(Bundle savedInstanceState) {
findViews();

try {
JSONArray mArgs = new JSONArray(getIntent().getStringExtra("ARGS"));
this.mImage = mArgs.getString(0);
this.mTitle = mArgs.getString(1);
this.mShare = mArgs.getBoolean(2);
Expand Down
2 changes: 1 addition & 1 deletion src/android/PhotoViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected void getPermission() {
//
protected void launchActivity() throws JSONException {
Intent i = new Intent(this.cordova.getActivity(), com.sarriaroman.PhotoViewer.PhotoActivity.class);
PhotoActivity.mArgs = this.args;
i.putExtra("ARGS", this.args.toString());

this.cordova.getActivity().startActivity(i);
this.callbackContext.success("");
Expand Down