aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-30 21:30:55 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-30 21:30:55 +0200
commit511f74116fe428c6cba69f4a50bfe38b1cc008c3 (patch)
tree2f613d7de1fd6fa27875129b8b875b99b21d97f4 /src/eu/siacs
parent88e5713a802b5061f8b35304342baef0280c6092 (diff)
fixed npe for the rare case that user has disabled his action bar
Diffstat (limited to 'src/eu/siacs')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index e0bfc540..b04fc131 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -18,6 +18,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
+import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.app.PendingIntent;
@@ -157,7 +158,7 @@ public class ConversationActivity extends XmppActivity {
if (view == null) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (View) inflater.inflate(
- R.layout.conversation_list_row, null);
+ R.layout.conversation_list_row, parent,false);
}
Conversation conv;
if (conversationList.size() > position) {
@@ -261,9 +262,12 @@ public class ConversationActivity extends XmppActivity {
@Override
public void onPanelOpened(View arg0) {
paneShouldBeOpen = true;
- getActionBar().setDisplayHomeAsUpEnabled(false);
- getActionBar().setHomeButtonEnabled(false);
- getActionBar().setTitle(R.string.app_name);
+ ActionBar ab = getActionBar();
+ if (ab!=null) {
+ ab.setDisplayHomeAsUpEnabled(false);
+ ab.setHomeButtonEnabled(false);
+ ab.setTitle(R.string.app_name);
+ }
invalidateOptionsMenu();
hideKeyboard();
}
@@ -273,10 +277,13 @@ public class ConversationActivity extends XmppActivity {
paneShouldBeOpen = false;
if ((conversationList.size() > 0)
&& (getSelectedConversation() != null)) {
- getActionBar().setDisplayHomeAsUpEnabled(true);
- getActionBar().setHomeButtonEnabled(true);
- getActionBar().setTitle(
+ ActionBar ab = getActionBar();
+ if (ab!=null) {
+ ab.setDisplayHomeAsUpEnabled(true);
+ ab.setHomeButtonEnabled(true);
+ ab.setTitle(
getSelectedConversation().getName(useSubject));
+ }
invalidateOptionsMenu();
if (!getSelectedConversation().isRead()) {
xmppConnectionService