From 8134a7454304d42c3000b50633d7d36baa42d912 Mon Sep 17 00:00:00 2001 From: endian11 <Dana_Lee1016@126.com> Date: 星期一, 25 十一月 2019 17:57:30 +0800 Subject: [PATCH] 加入Facebook的Steho方便调试;使用Type 和JsonReader转化json文件为对象;使用TcpFragment页面调试数据库 --- app/src/main/java/safeluck/drive/evaluation/fragment/TcpFragment.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/TcpFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/TcpFragment.java index 0a9a4f8..f6a3ca5 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/TcpFragment.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/TcpFragment.java @@ -41,6 +41,7 @@ private Button btn_send; private ConnectThread connectThread; private AppCompatEditText sendEditText; + private WokViewModel workViewModel; public static TcpFragment newInstance() { return new TcpFragment(); @@ -51,7 +52,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_tcpclient, container, false); initView(view); - WokViewModel workViewModel =ViewModelProviders.of(this).get(WokViewModel.class); + workViewModel =ViewModelProviders.of(this).get(WokViewModel.class); workViewModel.getStudents().observe((LifecycleOwner) this, new Observer<List<Student>>() { @Override @@ -87,10 +88,12 @@ break; case R.id.btn_send: - if (connectThread != null){ - connectThread.sendMessage(sendEditText.getText().toString().trim()); - sendEditText.getText().clear(); - } +// if (connectThread != null){ +//// connectThread.sendMessage(sendEditText.getText().toString().trim()); +//// sendEditText.getText().clear(); +//// } + + workViewModel.insertStudent(new Student(1002,"鐜嬩簲","500107198910124566",1)); break; } } -- Gitblit v1.8.0