app/src/main/java/com/colorssoftware/logr/LoginActivity.java
@Override
                    public void onSuccess(String out) {
                        try {
                            if(!out.isEmpty()){
                                JSONObject jsonObject=new JSONObject(out);
                                JSONObject jsonObject1=jsonObject.getJSONObject("customer");
                                id=jsonObject1.getString("_id");
                                String username=jsonObject1.getString("username");
                                String email=jsonObject1.getString("email");
                                mResponse.setText("Customer Id: " + id + "\n"+"Name: " +username +"\n"+"Email: " +email);
                            //Passing customer id to Billing
                            Intent intent=new Intent(LoginActivity.this,BillingActivity.class);
                            intent.putExtra("id",id);
                            startActivity(intent);
                            }
                            else {
                                Toast.makeText(LoginActivity.this, "Response is empty", Toast.LENGTH_SHORT).show();
                            }

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                    }
/**
                     * Response coming from server
                     * Use it in your code
                     * @param out
                     */
Response coming from server
Use it in your code
@param out
Response coming from server Use it in your code @param out
@Override
                    public void onSuccess(String out) {
                        try {
                            if(!out.isEmpty()){
                                JSONObject jsonObject=new JSONObject(out);
                                JSONObject jsonObject1=jsonObject.getJSONObject("customer");
                                id=jsonObject1.getString("_id");
                                String username=jsonObject1.getString("username");
                                String email=jsonObject1.getString("email");
                                mResponse.setText("Customer Id: " + id + "\n"+"Name: " +username +"\n"+"Email: " +email);
                            Intent intent=new Intent(LoginActivity.this,BillingActivity.class);
                            intent.putExtra("id",id);
                            startActivity(intent);
                            }
                            else {
                                Toast.makeText(LoginActivity.this, "Response is empty", Toast.LENGTH_SHORT).show();
                            }
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
@ Override public void onSuccess ( String out ) { try { if ( ! out . isEmpty ( ) ) { JSONObject jsonObject = new JSONObject ( out ) ; JSONObject jsonObject1 = jsonObject . getJSONObject ( "customer" ) ; id = jsonObject1 . getString ( "_id" ) ; String username = jsonObject1 . getString ( "username" ) ; String email = jsonObject1 . getString ( "email" ) ; mResponse . setText ( "Customer Id: " + id + "\n" + "Name: " + username + "\n" + "Email: " + email ) ; Intent intent = new Intent ( LoginActivity . this , BillingActivity . class ) ; intent . putExtra ( "id" , id ) ; startActivity ( intent ) ; } else { Toast . makeText ( LoginActivity . this , "Response is empty" , Toast . LENGTH_SHORT ) . show ( ) ; } } catch ( JSONException e ) { e . printStackTrace ( ) ; } }
Response coming from server
 Use it in your code
 @param out
Response coming from server Use it in your code @param out
//Passing customer id to Billing