| | |
| | | btn_send.setOnClickListener(this); |
| | | btn_connect.setOnClickListener(this); |
| | | } |
| | | |
| | | int r ; |
| | | @Override |
| | | public void onClick(View v) { |
| | | switch (v.getId()){ |
| | | case R.id.btn_connect: |
| | | // String serverIp = ip.getText().toString().trim(); |
| | | // String serverPort = port.getText().toString().trim(); |
| | | // String serverPort = port.getText().toStrirng().trim(); |
| | | // connectThread = new ConnectThread(serverIp,Integer.parseInt(serverPort)); |
| | | // connectThread.start(); |
| | | |
| | | Random random = new Random(); |
| | | r = random.nextInt(30)+1; |
| | | Log.i(TAG, "onClick: 随机数="+r); |
| | | WorkRoomDataBase.dataBaseWriteExecutor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | |
| | | WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getFailProjDao().insert(new FailedProj(1, new Random(30).nextInt()+1)); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getFailProjDao().insert(new FailedProj(1, r)); |
| | | } |
| | | }); |
| | | |