From 7b0f069d3e0fe39805143190f7d1bac8752f51e0 Mon Sep 17 00:00:00 2001 From: hanxueqing <1045352474@qq.com> Date: Sat, 4 Jan 2020 22:36:43 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' # Conflicts: # app/src/main/res/layout/activity_main.xml --- .../PersonalCenter/SearchServiceGet.java | 2 ++ .../example/cmknowledgegraph/ConditionCode.java | 4 ++-- .../example/cmknowledgegraph/SearchContent.java | 17 ++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/example/PersonalCenter/SearchServiceGet.java b/app/src/main/java/com/example/PersonalCenter/SearchServiceGet.java index 9ef0e5d..4f0dd95 100644 --- a/app/src/main/java/com/example/PersonalCenter/SearchServiceGet.java +++ b/app/src/main/java/com/example/PersonalCenter/SearchServiceGet.java @@ -52,7 +52,9 @@ public class SearchServiceGet { //开始解析返回的数据 JSONObject jo=JSONObject.fromObject(response.toString()); code=jo.getInt("code"); + System.out.println("code==@@@@@@@@@@20"+code); if(code!=0){ //查询成功,在开始解析数据 + System.out.println("code==@@@@@@@@@@20"+code); name_back=jo.getString("message");//查询的主语 //把data看作一个JSONObject,无论里面由多少元素,都转换为JSONArray,存在数组里 JSONObject jo_data=jo.getJSONObject("data"); diff --git a/app/src/main/java/com/example/cmknowledgegraph/ConditionCode.java b/app/src/main/java/com/example/cmknowledgegraph/ConditionCode.java index 6812158..5edc12b 100644 --- a/app/src/main/java/com/example/cmknowledgegraph/ConditionCode.java +++ b/app/src/main/java/com/example/cmknowledgegraph/ConditionCode.java @@ -8,8 +8,8 @@ public interface ConditionCode { * MedicineToOperation 药 用法 * MedicineToSympton 药 作用 */ - public final int DiseaseToSymptom=100; - public final int DiseaseToMedicines=200; + public final int DiseaseToSymptom=200; + public final int DiseaseToMedicines=100; public final int MedicineToOperation=300; public final int MedicineToSymptom=400; diff --git a/app/src/main/java/com/example/cmknowledgegraph/SearchContent.java b/app/src/main/java/com/example/cmknowledgegraph/SearchContent.java index 358bb99..7a1c8ab 100644 --- a/app/src/main/java/com/example/cmknowledgegraph/SearchContent.java +++ b/app/src/main/java/com/example/cmknowledgegraph/SearchContent.java @@ -36,12 +36,19 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Log.i("haha", "=======Oncli"); // //点击查找按钮之后,取出输入的句子,传给后台 String inputContent = search_edit.getText().toString(); -// SearchServiceGet.executeSearchGet(inputContent); - SearchServiceGet.exxcuteTest(inputContent); + new Thread(new Runnable() { + @Override + public void run() { + SearchServiceGet.executeSearchGet(inputContent); + Intent intent = new Intent(); + intent.setClass(getActivity(), SearchEntryActivity.class); + startActivity(intent); + } + }).start(); + +// SearchServiceGet.exxcuteTest(inputContent); // //执行到这里,已经把data里的数据取出来了或没有,但是都要跳转页面到SearchEntryActivity页面 - Intent intent = new Intent(); - intent.setClass(getActivity(), SearchEntryActivity.class); - startActivity(intent); + } }); }