| Index: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
|
| diff --git a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
|
| index ee1695afd1e9cd60fe25a0d44bd8a1ef271a023e..4b890bd5e1279cb2437a205d581b54aa04dffabc 100644
|
| --- a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
|
| +++ b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java
|
| @@ -12,7 +12,6 @@
|
| public class ViewerApplication extends Application {
|
| private long mNativeHandle = 0;
|
| private ViewerActivity mViewerActivity;
|
| - private String mStateJsonStr, mTitle;
|
|
|
| static {
|
| System.loadLibrary("skia_android");
|
| @@ -42,40 +41,16 @@
|
| }
|
|
|
| public void setViewerActivity(ViewerActivity viewerActivity) {
|
| - mViewerActivity = viewerActivity;
|
| - // Note that viewerActivity might be null (called by onDestroy)
|
| - if (mViewerActivity != null) {
|
| - // A new ViewerActivity is created; initialize its state and title
|
| - if (mStateJsonStr != null) {
|
| - mViewerActivity.setState(mStateJsonStr);
|
| - }
|
| - if (mTitle != null) {
|
| - mViewerActivity.setTitle(mTitle);
|
| - }
|
| - }
|
| + this.mViewerActivity = viewerActivity;
|
| }
|
|
|
| public void setTitle(String title) {
|
| - mTitle = title; // Similar to mStateJsonStr, we have to store this.
|
| + final String finalTitle = title;
|
| if (mViewerActivity != null) {
|
| mViewerActivity.runOnUiThread(new Runnable() {
|
| @Override
|
| public void run() {
|
| - mViewerActivity.setTitle(mTitle);
|
| - }
|
| - });
|
| - }
|
| - }
|
| -
|
| - public void setState(String stateJsonStr) {
|
| - // We have to store this state because ViewerActivity may be destroyed while the native app
|
| - // is still running. When a new ViewerActivity is created, we'll pass the state to it.
|
| - mStateJsonStr = stateJsonStr;
|
| - if (mViewerActivity != null) {
|
| - mViewerActivity.runOnUiThread(new Runnable() {
|
| - @Override
|
| - public void run() {
|
| - mViewerActivity.setState(mStateJsonStr);
|
| + mViewerActivity.setTitle(finalTitle);
|
| }
|
| });
|
| }
|
|
|