0

I have just started working in Android Studio for a few days, I use Android Studio 3.0.1 and I want to write simple login app that makes a post request to a server.

My colleage has prepared for me an api that I should connect.

The problem is that I'm not sure whether my app is working properly, i.e. app starts on an emulator, I can debug it though program does not step into post method.

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        AsyncHttpClient client = new AsyncHttpClient();

        RequestParams rp = new RequestParams();
        rp.add("username", "user1@domain.ru");
        rp.add("password", "123456");

        client.post("https://wms.subdomain.domain.ru/api/v1/auth", rp, new BaseJsonHttpResponseHandler(String.valueOf(Looper.getMainLooper())) {

            @Override
            public void onSuccess(int statusCode, Header[] headers, String rawJsonResponse, Object response) {
            }

            @Override
            public void onFailure(int statusCode, Header[] headers, Throwable throwable, String rawJsonData, Object errorResponse) {

            }

            @Override
            protected Object parseResponse(String rawJsonData, boolean isFailure) throws Throwable {
                return null;
            }
        });
    }
}

Futher the same code is shown in the picture. The debug process comes straight away.

The point is that debug process does not step into post method.

Michael
  • 57,169
  • 9
  • 80
  • 125
Anatoly
  • 3,266
  • 4
  • 17
  • 28

0 Answers0