|
31 | 31 | import android.view.View;
|
32 | 32 | import android.widget.EditText;
|
33 | 33 | import android.widget.RadioGroup;
|
| 34 | +import android.widget.Toast; |
34 | 35 |
|
35 | 36 | import com.android.setupwizardlib.SetupWizardLayout;
|
36 | 37 | import com.android.setupwizardlib.view.NavigationBar;
|
@@ -58,6 +59,8 @@ protected void onCreate(Bundle savedInstanceState) {
|
58 | 59 | setContentView(R.layout.activity_add_account);
|
59 | 60 | SetupWizardLayout layout = (SetupWizardLayout) findViewById(R.id.setup_wizard_layout);
|
60 | 61 | layout.getNavigationBar().setNavigationBarListener(this);
|
| 62 | + NavigationBar navigationBar = layout.getNavigationBar(); |
| 63 | + navigationBar.getBackButton().setEnabled(false); |
61 | 64 |
|
62 | 65 | Bundle extras = getIntent().getExtras();
|
63 | 66 | if (extras != null) {
|
@@ -92,6 +95,9 @@ public void run(AccountManagerFuture<Bundle> accountManagerFuture) {
|
92 | 95 | } catch (OperationCanceledException | AuthenticatorException
|
93 | 96 | | IOException e) {
|
94 | 97 | Log.e(TAG, "addAccount - failed", e);
|
| 98 | + Toast.makeText(AddAccountActivity.this, |
| 99 | + R.string.fail_to_add_account, Toast.LENGTH_LONG).show(); |
| 100 | + return; |
95 | 101 | }
|
96 | 102 | Log.d(TAG, "addAccount - isAccountAdded: " + isAccountAdded
|
97 | 103 | + ", accountNameAdded: " + accountNameAdded);
|
@@ -134,7 +140,5 @@ public void onClick(DialogInterface dialogInterface, int i) {
|
134 | 140 | }
|
135 | 141 |
|
136 | 142 | @Override
|
137 |
| - public void onNavigateBack() { |
138 |
| - onBackPressed(); |
139 |
| - } |
| 143 | + public void onNavigateBack() {} |
140 | 144 | }
|
0 commit comments