summaryrefslogtreecommitdiffstats
path: root/remoting/android
diff options
context:
space:
mode:
authorkelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 22:26:22 +0000
committerkelvinp@chromium.org <kelvinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 22:26:22 +0000
commit09cee4a59b7ec6bcee027a8105e2843f23b1a90e (patch)
treedb2805d63b233a9b7c2af77942548882152fe45a /remoting/android
parent0f939daffbdbf70a3e1ec0ef61160761caa26d26 (diff)
downloadchromium_src-09cee4a59b7ec6bcee027a8105e2843f23b1a90e.zip
chromium_src-09cee4a59b7ec6bcee027a8105e2843f23b1a90e.tar.gz
chromium_src-09cee4a59b7ec6bcee027a8105e2843f23b1a90e.tar.bz2
Fix Chromoting Android client crashed on launch
We crash because mRefreshButton is null when updateUI() is called. mRefreshButton is initialized on onCreateOptionsMenu() According to http://stackoverflow.com/questions/13267030/oncreateoptionsmenu-is-never-called, seems like onCreateOptionMenu will never got called on some themes on phones with menu button. I can repro by overriding the theme to @android:style/Theme.Black.NoTitleBar The fix is adding a null check. BUG=364591 Review URL: https://codereview.chromium.org/308793007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/android')
-rw-r--r--remoting/android/java/src/org/chromium/chromoting/Chromoting.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
index dd90888..29aec73 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -19,7 +19,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
-import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
@@ -397,8 +396,9 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
* Updates the infotext and host list display.
*/
private void updateUi() {
- mRefreshButton.setEnabled(mAccount != null);
-
+ if (mRefreshButton != null) {
+ mRefreshButton.setEnabled(mAccount != null);
+ }
ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, R.layout.host, mHosts);
Log.i("hostlist", "About to populate host list display");
mHostListView.setAdapter(displayer);