Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java

Issue 1978843002: Change Android activity title from JNI call (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9389f7220810b458d0075d155087e0d1c37578dd..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
@@ -11,6 +11,7 @@ import android.app.Application;
public class ViewerApplication extends Application {
private long mNativeHandle = 0;
+ private ViewerActivity mViewerActivity;
static {
System.loadLibrary("skia_android");
@@ -38,4 +39,20 @@ public class ViewerApplication extends Application {
public long getNativeHandle() {
return mNativeHandle;
}
+
+ public void setViewerActivity(ViewerActivity viewerActivity) {
+ this.mViewerActivity = viewerActivity;
+ }
+
+ public void setTitle(String title) {
+ final String finalTitle = title;
+ if (mViewerActivity != null) {
+ mViewerActivity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mViewerActivity.setTitle(finalTitle);
+ }
+ });
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698