Page 981 - 3-3
P. 981

public class Login extends AppCompatActivity {
                EditText txtID, txtPassword;
                Button btnLogin;


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


                    txtID = (EditText) findViewById(R.id.txtID);
                    txtPassword = (EditText) findViewById(R.id.txtPassword);
                    btnLogin = (Button) findViewById(R.id.btnLogin);


                    btnLogin.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {


                            if (Util.isRightUserInfo(txtID.getText().toString(), txtPassword.getText().toString()))
            {
                            //  유저 정보가 맞는지 확인
                                Intent intent = new Intent(getApplicationContext(), MainActivity.class);
                            //  유저정보가 맞다면 다음 화면으로 이동
                                startActivity(intent);
                            } else {
                                Toast.makeText(getApplicationContext(),      " 잘못된      유저       정보입니다.",
            Toast.LENGTH_SHORT).show();
                            //  유저정보가 잘못됬다면 토스트 띄움
                            }
                        }
                    });
                }
            }




                3) Parking Lot
            package com.mdp.mdp.parking;


            import com.mdp.mdp.Util;


            import org.json.JSONArray;
            import org.json.JSONException;
            import org.json.JSONObject;


            /**
             * Created by SORA on 2017-11-11.


                                                         - 981 -
   976   977   978   979   980   981   982   983   984   985   986