session-android/src/org/thoughtcrime/securesms/DeviceProvisioningActivity.java

45 lines
1.5 KiB
Java
Raw Normal View History

package org.thoughtcrime.securesms;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
2015-01-24 04:38:45 +00:00
import android.view.Window;
2019-07-24 02:30:23 +00:00
import network.loki.messenger.R;
public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActivity {
2018-02-02 03:22:48 +00:00
@SuppressWarnings("unused")
private static final String TAG = DeviceProvisioningActivity.class.getSimpleName();
@Override
protected void onPreCreate() {
2015-01-24 04:38:45 +00:00
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
}
@Override
2018-02-02 03:22:48 +00:00
protected void onCreate(Bundle bundle, boolean ready) {
assert getSupportActionBar() != null;
2015-01-24 04:38:45 +00:00
getSupportActionBar().hide();
AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle(getString(R.string.DeviceProvisioningActivity_link_a_signal_device))
.setMessage(getString(R.string.DeviceProvisioningActivity_it_looks_like_youre_trying_to_link_a_signal_device_using_a_3rd_party_scanner))
2018-02-02 03:22:48 +00:00
.setPositiveButton(R.string.DeviceProvisioningActivity_continue, (dialog1, which) -> {
Intent intent = new Intent(DeviceProvisioningActivity.this, DeviceActivity.class);
intent.putExtra("add", true);
startActivity(intent);
finish();
})
2018-02-02 03:22:48 +00:00
.setNegativeButton(R.string.DeviceProvisioningActivity_cancel, (dialog12, which) -> {
dialog12.dismiss();
finish();
})
2018-02-02 03:22:48 +00:00
.setOnDismissListener(dialog13 -> finish())
.create();
dialog.setIcon(getResources().getDrawable(R.drawable.icon_dialog));
dialog.show();
}
}