[英]URLClassLoader keeps throwing ClassNotFoundException. What am I doing wrong?
[英]I am trying to register a user with parse but it keeps throwing JSONException, what could be wrong?
saveUser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final ParseUser user = new ParseUser();
try {
user.setUsername("12345");
user.setPassword("1234");
} catch(Exception e){
e.getMessage();
}
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
// Sign-up successful!
Toast.makeText(getApplicationContext(),"Done",Toast.LENGTH_LONG).show();
} else {
// Failed
AlertDialog.Builder builder = new AlertDialog.Builder(SignupActivity.this);
builder.setMessage(e.getMessage())
.setTitle("Oops try again!!!")
.setPositiveButton(android.R.string.ok, null);
AlertDialog dialog = builder.create();
dialog.show();
// Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
});
錯誤的json響應:org.json.JSONException:類型java.lang.String的值無效,無法轉換為JSONObject
刪除final
ParseUser前-因為最終的變量應該是一成不變的,應該是這樣的:
ParseUser user = new ParseUser();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.