从活动开始
Intent intent = new Intent(StartActivity.this, MarkersActivity.class);
startActivityForResult(intent, GoMarkerReturn);
调用其他有 CustomListAdapter 的活动扩展 BaseAdapter。listview有一张图片,点击后关闭当前activity并将结果返回给启动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) 不起作用!