Source:
public boolean reInit(Conversation conversation) { if (conversation == null) { return false; } this.activity = (ConversationActivity) getActivity(); setupIme(); if (this.conversation != null) { final String msg = mEditMessage.getText().toString(); this.conversation.setNextMessage(msg); if (this.conversation != conversation) { updateChatState(this.conversation, msg); } this.conversation.trim(); } if (activity != null) { this.mSendButton.setContentDescription(activity.getString(R.string.send_message_to_x,conversation.getName())); } this.conversation = conversation; boolean canWrite = this.conversation.getMode() == Conversation.MODE_SINGLE || this.conversation.getMucOptions().participating(); this.mEditMessage.setEnabled(canWrite); this.mSendButton.setEnabled(canWrite); this.mEditMessage.setKeyboardListener(null); this.mEditMessage.setText(""); this.mEditMessage.append(this.conversation.getNextMessage()); this.mEditMessage.setKeyboardListener(this); messageListAdapter.updatePreferences(); this.messagesView.setAdapter(messageListAdapter); updateMessages(); this.conversation.messagesLoaded.set(true); if (conversation.getBooleanAttribute("rtt_status", false)) { rttStatusButton.setAlpha(Float.valueOf(R.attr.icon_alpha_active)); } synchronized (this.messageList) { final Message first = conversation.getFirstUnreadMessage(); final int bottom = Math.max(0, this.messageList.size() - 1); final int pos; if (first == null) { pos = bottom; } else { int i = getIndexOf(first.getUuid(), this.messageList); pos = i < 0 ? bottom : i; } messagesView.setSelection(pos); return pos == bottom; } }

Target:
public boolean reInit(Conversation conversation) { if (conversation == null) { return false; } this.activity = (ConversationActivity) getActivity(); setupIme(); this.ignoreOneEvent = new AtomicBoolean(false); if (this.conversation != null) { final String msg = mEditMessage.getText().toString(); this.conversation.setNextMessage(msg); if (this.conversation != conversation) { updateChatState(this.conversation, msg); } this.conversation.trim(); } if (activity != null) { this.mSendButton.setContentDescription(activity.getString(R.string.send_message_to_x,conversation.getName())); } if (rttEventListener != null) { rttEventListener.stop(); this.mEditMessage.removeTextChangedListener(this.rttEventListener); } this.conversation = conversation; this.mEditMessage.setKeyboardListener(null); this.mEditMessage.setText(""); this.mEditMessage.append(this.conversation.getNextMessage()); this.mEditMessage.setKeyboardListener(this); this.rttEventListener = new RttEventListener(this, conversation, activity); this.mEditMessage.addTextChangedListener(this.rttEventListener); messageListAdapter.updatePreferences(); this.messagesView.setAdapter(messageListAdapter); updateMessages(); this.conversation.messagesLoaded.set(true); checkRttButtonStatus(); synchronized (this.messageList) { final Message first = conversation.getFirstUnreadMessage(); final int bottom = Math.max(0, this.messageList.size() - 1); final int pos; if (first == null) { pos = bottom; } else { int i = getIndexOf(first.getUuid(), this.messageList); pos = i < 0 ? bottom : i; } messagesView.setSelection(pos); return pos == bottom; } }