use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.
the class QuestionActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
Intent intent = getIntent();
account = QuestionActivity.getAccount(intent);
user = QuestionActivity.getUser(intent);
if (AccountManager.getInstance().getAccount(account) == null || user == null) {
Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
finish();
return;
}
if (intent.getBooleanExtra(EXTRA_FIELD_CANCEL, false)) {
try {
OTRManager.getInstance().abortSmp(account, user);
} catch (NetworkException e) {
Application.getInstance().onError(e);
}
finish();
return;
}
showQuestion = intent.getBooleanExtra(EXTRA_FIELD_SHOW_QUESTION, true);
answerRequest = intent.getBooleanExtra(EXTRA_FIELD_ANSWER_REQUEST, false);
if (showQuestion) {
setContentView(R.layout.activity_question);
questionView = (EditText) findViewById(R.id.question);
questionView.setEnabled(!answerRequest);
if (answerRequest) {
questionView.setText(intent.getStringExtra(Intent.EXTRA_TEXT));
} else {
findViewById(R.id.cancel).setVisibility(View.GONE);
}
} else {
setContentView(R.layout.secret_viewer);
}
findViewById(R.id.cancel).setOnClickListener(this);
findViewById(R.id.send).setOnClickListener(this);
contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
contactTitleActionBarInflater.setUpActionBarView();
}
Aggregations