2016-12-15 5 views
0

Ich hole Bilder von Json und zeige es in einer Gridview. Wenn Sie ein Bild auswählen, wird das Bild auf Vollbild vergrößert und die Option zum Teilen ist verfügbar. Wenn ich auf die Option zum Teilen klicke, wird auf den Telefonen über API 22 die Ladezeile nicht gelöscht. Es funktioniert gut bis Lollipop. Ich weiß nicht, warum es in Marshmallow nicht funktioniert.Share Option funktioniert nicht für Marshmallow [Android]

Hier ist der Code

public void share(View view){ 
    // Get access to the URI for the bitmap 
    pDialog = new ProgressDialog(Displaydemo.this); 
    pDialog.setMessage("Loading..."); 
    pDialog.show(); 
    niv1 = (NetworkImageView) findViewById(R.id.imgNetwork); 
    Uri bmpUri = getLocalBitmapUri(niv1); 
    if (bmpUri != null) { 

     pDialog.dismiss(); 
     Intent shareIntent = new Intent(); 
     shareIntent.setAction(Intent.ACTION_SEND); 
     shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri); 
     shareIntent.putExtra(Intent.EXTRA_SUBJECT,"share"); 
     shareIntent.putExtra(Intent.EXTRA_TEXT,Datas.Address); 
     shareIntent.setType("image/*"); 
     startActivity(Intent.createChooser(shareIntent, "Share Image")); 
    } 
} 

Antwort

1

Sieht aus wie Sie Mashmallow Runtime Berechtigungsproblem konfrontiert sind. Sie beziehen sich auf diesen Beitrag Android 6: cannot share files anymore?

Auch wenn die v4 Support Library verwenden u ShareCompat für den Austausch statt https://medium.com/google-developers/sharing-content-between-android-apps-2e6db9d1368b#.wnlh9s3n7

+0

wie einzurichten Pfad XML-Datei verwendet werden soll. – Sreepulari

+0

@Sreepulari was meinst du mit "Wie erstelle ich eine Pfad-XML-Datei?" – pipeur10

+0

Legen Sie den Pfad res/xml/filepath.xml fest – Sreepulari

Verwandte Themen