当我从 中单击图片时galleryview
,我想显示从中选择的图片。我做了一个祝酒词,它给了我点击的图片,但我想在另一个活动中展示它。
我怎样才能做到这一点?
这是我的画廊活动。
public View getView(int position, View convertView, ViewGroup parent) {
inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View vi=convertView;
final Players players = getItem(position);
if(convertView==null){
vi = inflater.inflate(R.layout.pictures, null);
ImageView image=(ImageView) vi.findViewById(R.id.imageView1);
TextView text1=(TextView)vi.findViewById(R.id.textView1);
TextView text2=(TextView)vi.findViewById(R.id.textNom);
TextView text3=(TextView)vi.findViewById(R.id.textPost);
TextView text4=(TextView)vi.findViewById(R.id.textDdn);
text1.setText(players.getNm());
text2.setText(Html.fromHtml( players.getNom()).toString());
text3.setText(Html.fromHtml( players.getPost()).toString().replace("Ž", "é"));
text4.setText(players.getDdn());
imageLoader.displayImage(players.getImage()image,options);
galleryView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int position,long arg3) {
Toast.makeText(getApplicationContext(), players.getImage() , Toast.LENGTH_SHORT).show();
}
});
}
这就是我在其他活动中所做的,这让我有问题要展示它:
class ImageAdapter extends ArrayAdapter<Players> {
public ImageAdapter(Context context, int textViewResourceId,List<Players> objects) {
super(context, textViewResourceId, objects);
}
public View getView(int position, View convertView, ViewGroup parent) {
inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View vi=convertView;
Players players = getItem(position);
if(convertView==null){
vi = inflater.inflate(R.layout.gallery_player, null);
imageLoader.displayImage(players.getImage(), img, options);
}
return vi;
}
}
}