Add a null check on ActionBar since there isn't one present on Android
Wear devices.
Bug: 69375979
Bug: 64491917
Change-Id: I0758e3cd48a0bc2de7d33b3a48ea0ffae031823a
Fixes: 69375979
(cherry picked from commit 06fadfae96e54237e44f79e2a62b0522f7e8329f)
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsActivity.java b/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
index 71ae8cf..56f5594 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsActivity.java
@@ -16,6 +16,7 @@
package com.android.phone.settings;
+import android.app.ActionBar;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.MenuItem;
@@ -27,8 +28,10 @@
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
-
- getActionBar().setTitle(R.string.phone_accounts);
+ final ActionBar actionBar = getActionBar();
+ if (actionBar != null) {
+ actionBar.setTitle(R.string.phone_accounts);
+ }
getFragmentManager().beginTransaction().replace(
android.R.id.content, new PhoneAccountSettingsFragment()).commit();
}