Returning Data from the listview in the activity
From the start activity
Intent intent = new Intent(StartActivity.this, MarkersActivity.class);
startActivityForResult(intent, GoMarkerReturn);
call other activity in which there is CustomListAdapter extends
BaseAdapter. The listviewhas a picture, when clicked, to close the current
activity and return the result to the starting activity
public class CustomListAdapter extends BaseAdapter {
...
public View getView(int position, View convertView, ViewGroup parent) {
holder.imggo.setOnClickListener(new View.OnClickListener() {
...
@Override
public void onClick(View v) {
int clickedPosition = (Integer)v.getTag();
NewsItem newsItem = (NewsItem)listData.get(clickedPosition);
Long goID = newsItem.getID();
Intent myIntent = new Intent(v.getContext(),
StartActivity.class);
myIntent.putExtra("goID", goID);
setResult(0, myIntent);
setResult(0, myIntent) dont work!
No comments:
Post a Comment