Fixes a crash on login and another when clicking the mention button on an account page that hasn't loaded yet.

main
Vavassor 7 years ago
parent 292c4c3a88
commit fbd4150001
  1. 5
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
  2. 8
      app/src/main/java/com/keylesspalace/tusky/LoginActivity.java

@ -481,6 +481,10 @@ public class AccountActivity extends BaseActivity {
return true;
}
case R.id.action_mention: {
if (loadedAccount == null) {
// If the account isn't loaded yet, eat the input.
return false;
}
Intent intent = new Intent(this, ComposeActivity.class);
intent.putExtra("mentioned_usernames", new String[] { loadedAccount.username });
startActivity(intent);
@ -488,6 +492,7 @@ public class AccountActivity extends BaseActivity {
}
case R.id.action_open_in_web: {
if (loadedAccount == null) {
// If the account isn't loaded yet, eat the input.
return false;
}
Uri uri = Uri.parse(loadedAccount.url);

@ -217,8 +217,8 @@ public class LoginActivity extends AppCompatActivity {
}
@Override
protected void onPause() {
super.onPause();
protected void onStop() {
super.onStop();
SharedPreferences.Editor editor = preferences.edit();
editor.putString("domain", domain);
editor.putString("clientId", clientId);
@ -238,8 +238,8 @@ public class LoginActivity extends AppCompatActivity {
}
@Override
protected void onResume() {
super.onResume();
protected void onStart() {
super.onStart();
/* Check if we are resuming during authorization by seeing if the intent contains the
* redirect that was given to the server. If so, its response is here! */
Uri uri = getIntent().getData();

Loading…
Cancel
Save