GooglePhoto Share Dialog

StefMa

StefMa

Dauergast
450
Hi,

die Google+-App bzw. die Photo-App dazu, kann via ShareDialog ein Bild empfangen und automatisch nach Google+ hochladen.
Der ShareDialog erscheint überall, wenn man etwas teilen will, allerdings nicht in der Photo-App selbst!

Dies möchte ich ändern. Ich möchte, dass auch in der Photo-App der Dialog zum Sharen erscheint. Da kam mir die Idee, dass ich eine eigene App schreibe, die lediglich die entsprechende Activity von der Photo-App aufruft und das Bild/die Bilder mit übergibt.

Die Frage ist nur, wie mache ich das? :D

Also via LogCat und den ShareButton habe ich die Activity:
I/ActivityManager( 569): START u0 {act=android.intent.action.CHOOSER flg=0x1 cmp=android/com.android.internal.app.ChooserActivity (has clip) (has extras)} from pid 27187
I/ActivityManager( 569): Displayed android/com.android.internal.app.ChooserActivity: +189ms
I/ActivityManager( 569): START u0 {act=android.intent.action.SEND_MULTIPLE typ=*/* flg=0x3000001 cmp=com.google.android.apps.plus/com.google.android.apps.photos.phone.SendContentActivity (has clip) (has extras)} from pid 27187
I/ActivityManager( 569): Displayed com.google.android.apps.plus/com.google.android.apps.photos.phone.SendContentActivity: +198ms
W/InputMethodManagerService( 569): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@65c46368 attribute=null, token = android.os.BinderProxy@6571f760
I/art ( 2378): Heap trim of managed (duration=14.069891ms, advised=2MB) and native (duration=5.554709ms, advised=652KB) heaps. Managed heap utilization of 52%.
Daraus kann man auch lesen, dass gesendet wird der Typ */* und via SEND_MULTIPLE...

Doch was heißt das genau? Ich muss meiner App beibringen auch dieses zu Empfangen und dann genau das selbe weiter zu geben.

Das heißt, erstmal muss ich was EMpfangen können: (Dieses Tutorial?!)
Code:
<intent-filter>
        <action android:name="android.intent.action.SEND_MULTIPLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="*/*" />
</intent-filter>
Im Code dann:
Code:
void handleSendMultipleImages(Intent intent) {
    ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
    if (imageUris != null) {
        // Update UI to reflect multiple images being shared
    }
In meinem ArrayList sind nun die URI's... Diese Share ich dann weiter via (diesem Tutorial?!)
Code:
ArrayList<Uri> imageUris = new ArrayList<Uri>();
imageUris.add(imageUri1); // Add your image URIs here
imageUris.add(imageUri2);

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
shareIntent.setType("*/*");
startActivity(Intent.createChooser(shareIntent, "Share images to.."));

Nur beim Senden kann ich dann bei new Intent direkt
Code:
com.google.android.apps.photos.phone.SendContentActivity
Irgendwie angeben?! :O
eigentlch doch
Code:
Intent(this, com.google.apps.photos.phone.SendContentActivtiy.class);
Oder gibt es dazu irgendwelche restriktionen?!

Kann man mir eigentlich nachvollziehen?! :D
Wenn nicht, nicht schlimm. Ich halte auf dem laufenden...

Würde der Plan so aufgehen?! Kann da mal einer drüber schauen?! Theoretisch schon, oder?

Danke und Gruß

P.s: Sry wegen unübersichtlichkeit und so. Bin in eile ;)
 

Ähnliche Themen

W
  • waltsoft
Antworten
4
Aufrufe
930
waltsoft
W
D
Antworten
2
Aufrufe
957
swa00
swa00
D
Antworten
9
Aufrufe
1.730
jogimuc
J
Zurück
Oben Unten