<pre style="font-family:'굴림체';font-size:9pt;"></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;"></pre><pre style="font-size:9pt;font-family:'굴림체';"> <span style="color:#000080;font-weight:bold;">new </span>Response.Listener<String>() {</pre><pre style="font-family:'굴림체';font-size:9pt;">에서 json을 파악한다음</pre><pre style="font-family:'굴림체';font-size:9pt;"></pre><pre style="font-size:9pt;font-family:'굴림체';"> displayAlert(code); 이 함수를 통해 완료됬다고 인식한후에 성공이나 실패를 판가름하여 </pre><pre style="font-size:9pt;font-family:'굴림체';">가입성공을 통해 finish 되거나</pre><pre style="font-size:9pt;font-family:'굴림체';"><span style="color:#000080;font-weight:bold;">else if</span>(<span style="color:#660e7a;">code</span>.equals(<span style="color:#008000;font-weight:bold;">"reg_failed"</span>)) 통해 초기화 되어야 하는데 이 버튼이 이 부분에서만 작동이 안됩니다.</pre><pre style="font-size:9pt;font-family:'굴림체';"><br></pre><pre style="font-size:9pt;font-family:'굴림체';">- 빈공간일때 정상</pre><pre style="font-size:9pt;font-family:'굴림체';">- 비밀번호와 비밀번호 확인 2개를 비교했을때 뜨는 창도 정상</pre><pre style="font-size:9pt;font-family:'굴림체';"><br></pre><pre style="font-size:9pt;font-family:'굴림체';">-> 모든 공간에 정보를 치고 확인하여 끝낼때 무응답입니다...</pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><pre style="font-family:'굴림체';font-size:9pt;"><br></pre><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</span>);<br><br><span style="color:#660e7a;font-weight:bold;">rg_bn </span>= (Button)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_bn</span>);<br><span style="color:#660e7a;font-weight:bold;">Name </span>= (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_name</span>);<br><span style="color:#660e7a;font-weight:bold;">Email </span>= (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_email</span>);<br><span style="color:#660e7a;font-weight:bold;">UserName </span>= (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_username</span>);<br><span style="color:#660e7a;font-weight:bold;">Password </span>= (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_password</span>);<br><span style="color:#660e7a;font-weight:bold;">ConPassword </span>= (EditText)findViewById(R.id.<span style="color:#660e7a;font-weight:bold;font-style:italic;">rg_conpassword</span>);<br><span style="color:#660e7a;font-weight:bold;">builder </span>= <span style="color:#000080;font-weight:bold;">new </span>AlertDialog.Builder(Register.<span style="color:#000080;font-weight:bold;">this</span>);<br><br><span style="color:#660e7a;font-weight:bold;">rg_bn</span>.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:#660e7a;font-weight:bold;">name </span>=<span style="color:#660e7a;font-weight:bold;">Name</span>.getText().toString();<br><span style="color:#660e7a;font-weight:bold;">email </span>=<span style="color:#660e7a;font-weight:bold;">Email</span>.getText().toString();<br><span style="color:#660e7a;font-weight:bold;">username </span>=<span style="color:#660e7a;font-weight:bold;">UserName</span>.getText().toString();<br><span style="color:#660e7a;font-weight:bold;">password </span>=<span style="color:#660e7a;font-weight:bold;">Password</span>.getText().toString();<br><span style="color:#660e7a;font-weight:bold;">conpass</span>=<span style="color:#660e7a;font-weight:bold;">ConPassword</span>.getText().toString();<br><br><span style="color:#000080;font-weight:bold;">if</span>(<span style="color:#660e7a;font-weight:bold;">name</span>.equals(<span style="color:#008000;font-weight:bold;">""</span>)||<span style="color:#660e7a;font-weight:bold;">email</span>.equals(<span style="color:#008000;font-weight:bold;">""</span>)||<span style="color:#660e7a;font-weight:bold;">username</span>.equals(<span style="color:#008000;font-weight:bold;">""</span>)||<span style="color:#660e7a;font-weight:bold;">password</span>.equals(<span style="color:#008000;font-weight:bold;">""</span>)||<span style="color:#660e7a;font-weight:bold;">conpass</span>.equals(<span style="color:#008000;font-weight:bold;">""</span>)){<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setTitle(<span style="color:#008000;font-weight:bold;">"형식 오류"</span>);<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setMessage(<span style="color:#008000;font-weight:bold;">"빈 공간이 존재합니다."</span>);<br> displayAlert(<span style="color:#008000;font-weight:bold;">"input_error"</span>);<br><br> }<span style="color:#000080;font-weight:bold;">else if </span>(!(<span style="color:#660e7a;font-weight:bold;">password</span>.equals(<span style="color:#660e7a;font-weight:bold;">conpass</span>))) {<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setTitle(<span style="color:#008000;font-weight:bold;">"비밀번호 확인"</span>);<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setMessage(<span style="color:#008000;font-weight:bold;">"비밀번호가 불일치합니다."</span>);<br> displayAlert(<span style="color:#008000;font-weight:bold;">"input_error"</span>);<br> } <span style="color:#000080;font-weight:bold;">else </span>{<br> StringRequest stringRequest = <span style="color:#000080;font-weight:bold;">new </span>StringRequest(Request.Method.<span style="color:#660e7a;font-weight:bold;font-style:italic;">POST</span>, <span style="color:#660e7a;font-weight:bold;">reg_url</span>,<br><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> JSONArray jsonArray = <span style="color:#000080;font-weight:bold;">new </span>JSONArray(response);<br> JSONObject jsonObject = jsonArray.getJSONObject(<span style="color:#0000ff;">0</span>);<br> String code = jsonObject.getString(<span style="color:#008000;font-weight:bold;">"code"</span>);<br> String message = jsonObject.getString(<span style="color:#008000;font-weight:bold;">"message"</span>);<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setTitle(<span style="color:#008000;font-weight:bold;">"server"</span>);<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setMessage(message);<br> displayAlert(code);<br><span style="color:#808080;font-style:italic;">// finish();<br></span><span style="color:#808080;font-style:italic;"> </span>} <span style="color:#000080;font-weight:bold;">catch </span>(JSONException e) {<br> e.printStackTrace();<br> }<br> }<br> }, <span style="color:#000080;font-weight:bold;">new </span>Response.ErrorListener() {<br><span style="color:#808000;">@Override<br></span><span style="color:#808000;"> </span><span style="color:#000080;font-weight:bold;">public void </span>onErrorResponse(VolleyError error) {<br><br> }<br> }) {<br><span style="color:#808000;">@Override<br></span><span style="color:#808000;"> </span><span style="color:#000080;font-weight:bold;">protected </span>Map<String, String> getParams() <span style="color:#000080;font-weight:bold;">throws </span>AuthFailureError {<br> Map<String, String> params = <span style="color:#000080;font-weight:bold;">new </span>HashMap<String, String>();<br> params.put(<span style="color:#008000;font-weight:bold;">"name"</span>, <span style="color:#660e7a;font-weight:bold;">name</span>);<br> params.put(<span style="color:#008000;font-weight:bold;">"email"</span>, <span style="color:#660e7a;font-weight:bold;">email</span>);<br> params.put(<span style="color:#008000;font-weight:bold;">"username"</span>, <span style="color:#660e7a;font-weight:bold;">username</span>);<br> params.put(<span style="color:#008000;font-weight:bold;">"password"</span>, <span style="color:#660e7a;font-weight:bold;">password</span>);<br><span style="color:#000080;font-weight:bold;">return </span>params;<br> }<br> };<br> MySingleton.<span style="font-style:italic;">getInstance</span>(Register.<span style="color:#000080;font-weight:bold;">this</span>).addToRequestQue(stringRequest);<br><br> }<br><br> }<br> });<br><br><br><br>}<br><span style="color:#000080;font-weight:bold;">public void </span>displayAlert(<span style="color:#000080;font-weight:bold;">final </span>String code){<br><span style="color:#660e7a;font-weight:bold;">builder</span>.setPositiveButton(<span style="color:#008000;font-weight:bold;">"OK"</span>, <span style="color:#000080;font-weight:bold;">new </span>DialogInterface.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(DialogInterface dialog, <span style="color:#000080;font-weight:bold;">int </span>which) {<br><span style="color:#000080;font-weight:bold;">if</span>(<span style="color:#660e7a;">code</span>.equals(<span style="color:#008000;font-weight:bold;">"input_error"</span>))<br> {<br><span style="color:#660e7a;font-weight:bold;">Password</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br><span style="color:#660e7a;font-weight:bold;">ConPassword</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br> }<br><span style="color:#000080;font-weight:bold;">else if</span>(<span style="color:#660e7a;">code</span>.equals(<span style="color:#008000;font-weight:bold;">"reg_success"</span>))<br> {<br> finish();<br> }<br><span style="color:#000080;font-weight:bold;">else if</span>(<span style="color:#660e7a;">code</span>.equals(<span style="color:#008000;font-weight:bold;">"reg_failed"</span>))<br> {<br><span style="color:#660e7a;font-weight:bold;">Name</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br><span style="color:#660e7a;font-weight:bold;">Email</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br><span style="color:#660e7a;font-weight:bold;">UserName</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br><span style="color:#660e7a;font-weight:bold;">Password</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br><span style="color:#660e7a;font-weight:bold;">ConPassword</span>.setText(<span style="color:#008000;font-weight:bold;">""</span>);<br> }<br> }<br> });<br><br> AlertDialog alertDialog = <span style="color:#660e7a;font-weight:bold;">builder</span>.create();<br> alertDialog.show();<br><br>}</pre>
<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>