问题描述:

working with php mysql multiple table and json need to pass data from one listview to another listview on another activity

i have been able to list the first listview activity i need to pass a foreign key which will enable me to get the details of the record in the second listview in the second activity

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;

}

});

}

}

相关阅读:
Top