I retrieve the data from server using php, I want send it to next activity
I already retrieve the id and name, How can I store it and send to next activity
This is my list view
private void loadIntoListView(String json) throws JSONException {
JSONArray jsonArray = new JSONArray(json);
String[] viewstudent= new String[jsonArray.length()];
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
viewstudent[i] = obj.getString("id") + " " + obj.getString("name");
//is here store it for send to next activity?
}
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, viewstudent);
lv.setAdapter(arrayAdapter);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
//I think here maybe send data to next activity
}
});
Have any simple way? Can give me some example?