这段代码给了我这个错误:错误:无法找到或加载主类undefined

时间:2017-04-14 17:16:58

标签: java android

我正在研究android studio上的一个项目,我正在编辑一个应用程序,这段代码给了我这个错误。这是应用程序的标志

public void signin() {

    showpDialog();

    CustomRequest jsonReq = new CustomRequest(Request.Method.POST, METHOD_ACCOUNT_LOGIN, null,
            new Response.Listener<JSONObject>() {
                @Override
                public void onResponse(JSONObject response) {

                    if (App.getInstance().authorize(response)) {

                        if (App.getInstance().getState() == ACCOUNT_STATE_ENABLED) {

                            Intent i = new Intent(getApplicationContext(), MainActivity.class);
                            startActivity(i);

                            ActivityCompat.finishAffinity(LoginActivity.this);

                        } else {

                            App.getInstance().logout();
                            Toast.makeText(LoginActivity.this, getText(R.string.msg_account_blocked), Toast.LENGTH_SHORT).show();
                        }

                    } else {

                        Toast.makeText(getApplicationContext(), getString(R.string.error_signin), Toast.LENGTH_SHORT).show();
                    }

                    hidepDialog();
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

            Toast.makeText(getApplicationContext(), getText(R.string.error_data_loading), Toast.LENGTH_LONG).show();

            hidepDialog();
        }
    }) {

        @Override
        protected Map<String, String> getParams() {
            Map<String, String> params = new HashMap<String, String>();
            params.put("username", username);
            params.put("password", password);
            params.put("clientId", CLIENT_ID);

            return params;
        }
    };

    App.getInstance().addToRequestQueue(jsonReq);
}

0 个答案:

没有答案