I am having a Framelayout and some TextViews in my application for which I am loading data from server and setting the background of FrameLayout with Image loaded from server using Picasso and setting TextViews in the same manner. But I want to share it using intent and I am unable to figure out how to do that? Do I have to download the Image First?
My Code in AsyncTask:
Picasso.with(ctx).load(myPlace.getImg()).into(new Target() {
@Override
public void onPrepareLoad(Drawable arg0) {
// TODO Auto-generated method stub
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom arg1) {
// TODO Auto-generated method stub
pImg.setBackgroundDrawable(new BitmapDrawable(ctx.getResources(), bitmap));
}
@Override
public void onBitmapFailed(Drawable arg0) {
// TODO Auto-generated method stub
Toast.makeText(ctx, "Failed Loading", Toast.LENGTH_SHORT).show();
}
});
pname.setText(myPlace.getName());
pdes.setText(myPlace.getDescription());
Share Button:
Button shareBtn = (Button) findViewById(R.id.sharebtn);