ich teilen müssen, eine externen URL Bild zusammen mit Text, von einem WebView, aber aus irgendeinem Grunde, den ich Fehler auf jedem Picasso Überschreibung erhalten:Android - Gemeinsame Nutzung Bild-URL + Text mit Picasso
Bereits implementiert die Javascript-Schnittstelle in Android.
@JavascriptInterface
public void shareContent(String text, String imageURL){
shareData(text, imageURL);
}
Fehler erhalte ich:Method does not override method from its superclass
.
public void shareData(String url) {
Picasso.with(getApplicationContext()).load(url).into(new AppLink.Target() {
@Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("image/*");
i.putExtra(Intent.EXTRA_STREAM, getLocalBitmapUri(bitmap));
startActivity(Intent.createChooser(i, "Share Image"));
}
@Override public void onBitmapFailed(Drawable errorDrawable) { }
@Override public void onPrepareLoad(Drawable placeHolderDrawable) { }
});
}
Und die Methode, um die lokale gespeicherte Bild zu erhalten
public Uri getLocalBitmapUri(Bitmap bmp) {
Uri bmpUri = null;
try {
File file = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), "share_image_" + System.currentTimeMillis() + ".png");
FileOutputStream out = new FileOutputStream(file);
bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
out.close();
bmpUri = Uri.fromFile(file);
} catch (IOException e) {
e.printStackTrace();
}
return bmpUri;
}
suchen Wie Ist das kein Duplikat? https://stackoverflow.com/questions/23681177/picasso-load-image-from-filesystem –
ich bin. Sie lesen eine Datei von der Festplatte und rufen dann eine Freigabe ab. Nicht sicher, warum Picasso überhaupt benötigt wird. –
Für Leistung. – Isabelle