Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void userSingIn(){
- String cardId = editcard.getText().toString().trim();
- Retrofit retrofit = new Retrofit.Builder()
- .baseUrl(APIUrl.DETAILS_URL)
- .addConverterFactory(GsonConverterFactory.create())
- .build();
- APIService service = retrofit.create(APIService.class);
- final User user = new User();
- user.setCardId(cardId);
- Call<Result> call = service.loginUser(
- user.getCardId()
- );
- call.enqueue(new Callback<Result>() {
- @Override
- public void onResponse(Call<Result> call, Response<Result> response) {
- Toast.makeText(getApplicationContext(), response.body().getPoints(), Toast.LENGTH_LONG).show();
- userpass = response.body().getPassword();
- points = response.body().getPoints();
- }
- @Override
- public void onFailure(Call<Result> call, Throwable t) {
- Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_LONG).show();
- }
- });
- }
Add Comment
Please, Sign In to add comment