Page 1197 - 3-3
P. 1197

writeSocket = new DataOutputStream(socket.getOutputStream());
                            readSocket = new DataInputStream(socket.getInputStream());
                            mHandler.post(new Runnable() {
                                @Override
                                public void run() {
                                    // TODO Auto-generated method stub
                                    setToast(" 연결에 성공하였습니다.");
                                    mTask = new TimerTask() {
                                        @Override
                                        public void run() {
                                            (new sendMessagew()).start();
                                        }
                                    };
                                    mTimer=new Timer();
                                    mTimer.schedule(mTask,0,5000);
                                }
                            });
                        } catch (Exception e) {
                            final String recvInput = " 연결에 실패하였습니다.";
                            Log.d("Connect", e.getMessage());
                            mHandler.post(new Runnable() {
                                @Override
                                public void run() {
                                    // TODO Auto-generated method stub
                                    setToast(recvInput);
                                }
                            });
                        }
                    }
                }
                void setToast(String msg) {
                    Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
                }
            }


            <ScalableLayout.java>


            package mdp3.a10_12_test;


            import android.content.Context;
            import android.content.res.TypedArray;
            import android.graphics.Bitmap;
            import android.graphics.BitmapFactory;
            import android.graphics.Color;
            import android.graphics.drawable.BitmapDrawable;


                                                         - 1197 -
   1192   1193   1194   1195   1196   1197   1198   1199   1200   1201   1202