Closed cristianhoyos66-zz closed 8 years ago
Thanks for this report!
So what is the problem exactly?
Are both onSuccess
and onError
of the ResultListener
called sometimes, but not always?
The problem persist with both onSucess
and onErrror
I am doing this:
LoginActivity
@Override
protected void onStart() {
super.onStart();
ConnectionDDP connectionDDP = new ConnectionDDP(this);
mMeteor = connectionDDP.getmMeteor();
for (int i = 0; i < 10; i++) {
mMeteor.loginWithUsername("prueba", "pruebapass", new ResultListener() {
@Override
public void onSuccess(String s) {
redirectServicesActivity();
}
@Override
public void onError(String s, String s1, String s2) {
System.out.println("S22" + s + "s33" + s1 + "s44" + s2);
}
});
}
}
username: "prueba" and password: "pruebapass" don't exist on bd and in fact execute this line System.out.println("S22" + s + "s33" + s1 + "s44" + s2);
10 times
but the problem arises when I try to do a login with this mMeteor.loginWithUsername
inside a View.OnClickListener
that onSucces
and onError
sometimes executes their respective process, but not always that I do a click on the login button.
thank you.
So you're saying that the ResultListener
usually works without any problems, but when used inside of an OnClickListener
, it does not work (reliably). Right?
Yes, I do.
I don't know why is it happening :/
Please use log statements in the first line of private void actionSignin
, public void onClick
, public void onSuccess
and public void onError
each.
This way you can verify if these parts of the code are executed at all.
I'm not sure why things should work in onStart
but not inside an OnClickListener
. Both are executed on the main (UI) thead.
I was doing some tests and I gave with the solution. Afortunately It is not a bug.
The problem was my emulator, but I didn't think that it could happen hehe So I changed the emulator and I tested on a real device and it works good on both.
Thank you so much.
Hi, thank you again for this library, but i have a problem with this:
I am calling a method of this way
and the ResultListener sometimes work. I try to do a login with username and password that can't be found on database, and it should must to execute this line
System.out.println("S22" + s + "s33" + s1 + "s44" + s2);
but sometime is executed. All process inactionSignin()
method is executed, but ResultListener sometimes.Do you know why is this happening or is this a bug?
Thank you