mirror of
https://github.com/ChronosX88/Influence.git
synced 2024-11-23 18:12:18 +00:00
Fixed bug with LoginActivity (not finished MainActivity when LoginActivity is started)
This commit is contained in:
parent
0fefada982
commit
6f844cb924
@ -55,6 +55,7 @@ interface CoreContracts {
|
||||
interface IMainViewContract {
|
||||
fun showSnackbar(message: String)
|
||||
fun showProgressBar(state: Boolean)
|
||||
fun finishActivity()
|
||||
}
|
||||
|
||||
// -----ChatActivity-----
|
||||
|
@ -31,6 +31,7 @@ class MainPresenter(private val view: CoreContracts.IMainViewContract) : CoreCon
|
||||
val intent = Intent(AppHelper.getContext(), LoginActivity::class.java)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
AppHelper.getContext().startActivity(intent)
|
||||
view.finishActivity()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,9 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
||||
jidEditText.setError(null);
|
||||
passwordEditText.setError(null);
|
||||
|
||||
jidInputLayout.setError(null);
|
||||
passwordInputLayout.setError(null);
|
||||
|
||||
String jid = jidEditText.getText().toString();
|
||||
String password = passwordEditText.getText().toString();
|
||||
|
||||
@ -161,6 +164,7 @@ public class LoginActivity extends AppCompatActivity implements CoreContracts.IL
|
||||
case AuthenticationStatusEvent.CONNECT_AND_LOGIN_SUCCESSFUL: {
|
||||
loadingScreen(false);
|
||||
finish();
|
||||
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||
break;
|
||||
}
|
||||
case AuthenticationStatusEvent.INCORRECT_LOGIN_OR_PASSWORD: {
|
||||
|
@ -143,4 +143,9 @@ public class MainActivity extends AppCompatActivity implements CoreContracts.IMa
|
||||
super.onStop();
|
||||
presenter.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishActivity() {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user