使用php mysql多表和json需要将数据从一个listview传递到另一个listview上的另一个listview
我已经能够列出我需要传递外键的第一个listview活动,这将使我能够在第二个活动的第二个列表视图中获取记录的详细信息
DetailsActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
PostResponseAsyncTask taskRead = new PostResponseAsyncTask(DetailActivity.this, this);
taskRead.execute("http://10.0.3.2/mcause/caseList.php");
String Courtroom ="";
String Casedate = "";
String Suiteno = "";
String Litigants = "";
String Judge = "";
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Intent in = getIntent();
if(null != in){
Courtroom = in.getStringExtra(Courtroom);
}
}
@Override
public void processFinish(String s) {
casesList = new JsonConverter<Cases>().toArrayList(s, Cases.class);
BindDictionary<Cases> dict = new BindDictionary<Cases>();
dict.addStringField(R.id.Casedate, new StringExtractor<Cases>() {
@Override
public String getStringValue(Cases item, int position) {
return item.CaseDate;
}
});
dict.addStringField(R.id.Suiteno, new StringExtractor<Cases>() {
@Override
public String getStringValue(Cases item, int position) {
return item.Suiteno;
}
});
dict.addStringField(R.id.Litigants, new StringExtractor<Cases>() {
@Override
public String getStringValue(Cases item, int position) {
return item.Litigants;
}
});
dict.addStringField(R.id.Judge, new StringExtractor<Cases>() {
@Override
public String getStringValue(Cases item, int position) {
return item.Judge;
}
});
}
}