# Conflicts:
#	cmkg/pom.xml
#	cmkg/src/main/java/com/cmkg/cmkg/CmkgApplication.java
#	cmkg/src/main/java/com/cmkg/cmkg/Controller/QuestionController.java
#	cmkg/src/main/java/com/cmkg/cmkg/database/ReturnData.java
#	cmkg/src/main/java/com/cmkg/cmkg/node/medicine.java
#	cmkg/src/main/java/com/cmkg/cmkg/process/ModelProcess.java
#	cmkg/src/main/java/com/cmkg/cmkg/repository/MedicineRespository.java
#	cmkg/src/main/java/com/cmkg/cmkg/repository/QuestionRespository.java
#	cmkg/src/main/java/com/cmkg/cmkg/server/QuestionService.java
#	cmkg/src/main/java/com/cmkg/cmkg/server/impl/QuestionServiceImpl.java
#	cmkg/src/main/resources/application.properties
master
hanxueqing 5 years ago
parent cbc4c193e8
commit 0a43ee1a7a

@ -80,7 +80,6 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
//获取response后将这个json数据解析
ReturnData response = (ReturnData) bundle.getSerializable("msg");
System.out.println("code=!!!!!!!!1"+response.getCode());
Log.i("response+++++",response+"返回值");
try {
@ -130,9 +129,11 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
*/
List<ContentData> list = new LinkedList<>();
String data=(String)response.getData();
JSONObject jo=new JSONObject(data);
String medicine_symptom=jo.getString("symptom");
// JSONObject jo=new JSONObject(response.getData().toString());
String str=(String)response.getData();
System.out.println("返回的数据事:"+str);
JSONObject jo=new JSONObject(str.toString());
String medicine_symptom=jo.getString("fuction");
list.add(new ContentData(medicine_symptom));
lists.add(list);
String disease_names=new String(jo.getString("name"));
@ -183,20 +184,25 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
* nhmnhmnhm
*/
TextView asscoiate_text=findViewById(R.id.asscoiate_text);//显示文本“你可能感兴趣”
String[] texts=new String[3];//存放listView中的显示的数据
// String[] texts=new String[3];//存放listView中的显示的数据,只针对
// String[] new_texts=new String[1];
// String[]
String[] texts;
if(response.getCode()==DiseaseToSymptom){
/**
* nm
*/
texts=new String[1];
texts[0]=response.getMsg()+"应该吃什么药";
model_Text=Model_Symptom;
model_Text=Model_Medicines;
}else if(response.getCode()==DiseaseToMedicines){
/**
* nhmnhmnhm
*
*/
Random r=new Random();
texts=new String[3];
for(int i=0;i<3;i++) {
index[i] = r.nextInt(9) + 1;
texts[i]=content.get(index[i])+"能治什么病症";
@ -207,6 +213,7 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
*
* nhm
*/
texts=new String[1];
texts[0]=response.getMsg()+"能治什么病";
model_Text=Model_Function;
}else {
@ -214,6 +221,7 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
*
* nhm
*/
texts=new String[1];
texts[0]=response.getMsg()+"的用法";
model_Text=Model_Operation;
}
@ -246,6 +254,8 @@ public class SearchEntryActivity extends AppCompatActivity implements CardStackV
}
});
listView.setAdapter(view_adapter);
for(int i:new_color)
System.out.println("i="+i);
adapter.updateData(Arrays.asList(new_color),lists);
}
}

@ -2,7 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"

@ -101,7 +101,6 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/search_content"
style="@style/scores_item_style"
android:paddingLeft="10dp"

Loading…
Cancel
Save