<div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201611/1477935806815ad456e60f4574a36be217ba617bbc__mn261624__w454__h671__f24578__Ym201611.jpg" width="454" height="671" alt="bandicam 2016-11-01 02-36-00-958.jpg" style="border:none;" filesize="24578"></div> <div style="text-align:left;"><br></div> <div style="text-align:left;">액티비티에 이런식으로 되어있는</div> <div style="text-align:left;"><pre style="font-family:'굴림체';font-size:9pt;"><span style="color:#000080;font-weight:bold;">protected void </span>onCreate(Bundle savedInstanceState) {<br><span style="color:#000080;font-weight:bold;">super</span>.onCreate(savedInstanceState);<br> setContentView(R.layout.<span style="color:#660e7a;font-weight:bold;font-style:italic;">activity_register_activiy</span>);<br><span style="color:#000080;font-weight:bold;">final </span>EditText etName = (EditText) findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">etName</span>);<br><span style="color:#000080;font-weight:bold;">final </span>EditText etPassword = (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">etPassword</span>);<br><span style="color:#000080;font-weight:bold;">final </span>EditText etPhone = (EditText) findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">etPhone</span>);<br><span style="color:#000080;font-weight:bold;">final </span>EditText etBirth = (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">etBirth</span>);<br><br><span style="color:#000080;font-weight:bold;">final </span>Button bRegister = (Button) findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">bRegister</span>);<br><br> bRegister.setOnClickListener(<span style="color:#000080;font-weight:bold;">new </span>View.OnClickListener() {<br><span style="color:#808000;">@Override<br></span><span style="color:#808000;"> </span><span style="color:#000080;font-weight:bold;">public void </span>onClick(View v) {<br><span style="color:#000080;font-weight:bold;">final </span>String name = <span style="color:#660e7a;">etName</span>.getText().toString();<br><span style="color:#000080;font-weight:bold;">final </span>String password = <span style="color:#660e7a;">etPassword</span>.getText().toString();<br><span style="color:#000080;font-weight:bold;">final int </span>phone = Integer.<span style="font-style:italic;">parseInt</span>(<span style="color:#660e7a;">etPhone</span>.getText().toString());<br><span style="color:#000080;font-weight:bold;">final int </span>birth = Integer.<span style="font-style:italic;">parseInt</span>(<span style="color:#660e7a;">etBirth</span>.getText().toString());<br><br> Response.Listener<String> responseListener = <span style="color:#000080;font-weight:bold;">new </span>Response.Listener<String>() {<br><span style="color:#808000;">@Override<br></span><span style="color:#808000;"> </span><span style="color:#000080;font-weight:bold;">public void </span>onResponse(String response) {<br><span style="color:#000080;font-weight:bold;">try </span>{<br> JSONObject jsonResponse = <span style="color:#000080;font-weight:bold;">new </span>JSONObject(response);<br><span style="color:#000080;font-weight:bold;">boolean </span>success = jsonResponse.getBoolean(<span style="color:#008000;font-weight:bold;">"success"</span>);<br><span style="color:#000080;font-weight:bold;">if </span>(success) {<br> Intent intent = <span style="color:#000080;font-weight:bold;">new </span>Intent(RegisterActiviy.<span style="color:#000080;font-weight:bold;">this</span>, MainActivity.<span style="color:#000080;font-weight:bold;">class</span>);<br> RegisterActiviy.<span style="color:#000080;font-weight:bold;">this</span>.startActivity(intent);<br> } <span style="color:#000080;font-weight:bold;">else </span>{<br> AlertDialog.Builder builder = <span style="color:#000080;font-weight:bold;">new </span>AlertDialog.Builder(getApplicationContext());<br> builder.setMessage(<span style="color:#008000;font-weight:bold;">"Register Failed"</span>)<br> .setNegativeButton(<span style="color:#008000;font-weight:bold;">"Retry"</span>, <span style="color:#000080;font-weight:bold;">null</span>)<br> .create()<br> .show();<br> }<br> } <span style="color:#000080;font-weight:bold;">catch </span>(JSONException e) {<br> e.printStackTrace();<br> }<br> }<br> };<br><br> RegisterRequest registerRequest = <span style="color:#000080;font-weight:bold;">new </span>RegisterRequest(name, birth, phone, password, responseListener);<br> RequestQueue queue = Volley.<span style="font-style:italic;">newRequestQueue</span>(RegisterActiviy.<span style="color:#000080;font-weight:bold;">this</span>);<br> queue.add(registerRequest);<br> }<br> });</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">소스입니다.</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">데이터 입력값고 서버로 잘 들어가구요.</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">근데 4개중에 값을 하나도 넣지 않고 아래의 버튼을 누르면 어플이 종료되었습니다. 하고 꺼지는데</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">이 부분이 중간 트라이 캐치부분에서 커버되는 부분 아닌가요?? 왜 뜨는건지 이유를 잘 모르겠습니다.</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;">4개중에 1개라도 넣지 않거나 그럴경우 통합적으로 "빈 공간이 있습니다" 이런식으로 뜨게 하려면 무엇을 검색하거나 수정해야하나요??</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre></div><br>
<div style="text-align:center;"><img src="http://eusave.dothome.co.kr/gif.php?id=0B4MpkGgWbWt6T2lObjI2d293VW8" alt="iu.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div>
<div style="text-align:center;"><img_ src="http://eusave.dothome.co.kr/gif.php?id=0B1-Nk0QyKrjDeVlnM3hCYllaRkk" alt="iu.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div>
<div style="text-align:center;">
<div style="text-align:center;"><img_ src="http://eusave.dothome.co.kr/gif.php?id=0B1-Nk0QyKrjDeVlnM3hCYllaRkk" alt="iu.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div>
<div style="text-align:center;">
<div style="text-align:center;"><img_ src="http://eusave.dothome.co.kr/gif.php?id=0B1-Nk0QyKrjDRWlMa09ieDZsMlE" alt="iu.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div>
<div style="text-align:center;">
<div style="text-align:center;"><img_ src="http://eusave.dothome.co.kr/gif.php?id=0B8fuRvQ1iHqPX0lRN2drTXU5OWc" alt="iu.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div>
<div style="text-align:center;"></div></div></div></div>