Commit 82317520 by sikang

bug fix

parent 13c7d6b2
...@@ -75,8 +75,10 @@ public class DataBaseHelper { ...@@ -75,8 +75,10 @@ public class DataBaseHelper {
String name = cursor.getString(1); String name = cursor.getString(1);
data = new String[]{name, number}; data = new String[]{name, number};
} }
if(cursor!=null) {
cursor.close(); cursor.close();
} }
}
return data; return data;
} }
......
...@@ -22,8 +22,10 @@ import java.util.List; ...@@ -22,8 +22,10 @@ import java.util.List;
import tech.starwin.LibConfig; import tech.starwin.LibConfig;
import tech.starwin.R; import tech.starwin.R;
import tech.starwin.constants.ActionEnum; import tech.starwin.constants.ActionEnum;
import com.common.bean.TokenInfoBean; import com.common.bean.TokenInfoBean;
import com.common.bean.UserBean; import com.common.bean.UserBean;
import tech.starwin.utils.context_utils.EasyActivityResult; import tech.starwin.utils.context_utils.EasyActivityResult;
import tech.starwin.utils.format_utils.StringFormat; import tech.starwin.utils.format_utils.StringFormat;
...@@ -100,10 +102,10 @@ public class LoginManager { ...@@ -100,10 +102,10 @@ public class LoginManager {
new EasyActivityResult(activity).startForResult(intent, 0, new EasyActivityResult.OnResultListener() { new EasyActivityResult(activity).startForResult(intent, 0, new EasyActivityResult.OnResultListener() {
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 0) { // confirm that this response matches your request if (requestCode == 0 && data != null) { // confirm that this response matches your request
AccountKitLoginResult loginResult = data.getParcelableExtra(AccountKitLoginResult.RESULT_KEY); AccountKitLoginResult loginResult = data.getParcelableExtra(AccountKitLoginResult.RESULT_KEY);
if (loginResult == null) { if (loginResult == null) {
result.onLoginError(null); result.onLoginError(new AccountKitError(AccountKitError.Type.INITIALIZATION_ERROR));
} else if (loginResult.getError() != null) { } else if (loginResult.getError() != null) {
result.onLoginError(loginResult.getError()); result.onLoginError(loginResult.getError());
} else if (loginResult.wasCancelled()) { } else if (loginResult.wasCancelled()) {
...@@ -111,7 +113,8 @@ public class LoginManager { ...@@ -111,7 +113,8 @@ public class LoginManager {
} else { } else {
result.onLoginSuccess(loginResult); result.onLoginSuccess(loginResult);
} }
}else{
result.onLoginError(new AccountKitError(AccountKitError.Type.INITIALIZATION_ERROR));
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment