package cnx.cclink.unishare.demo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import cnx.cclink.unishare.ShareApi;
import cnx.cclink.unishare.ShareContent;
import cnx.cclink.unishare.ShareError;
import cnx.cclink.unishare.ShareListener;
import cnx.cclink.unishare.SharePlatform;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button shareBtn = (Button) findViewById(R.id.shareBtn);
        shareBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ShareApi.share(MainActivity.this, SharePlatform.QQ, new ShareContent("标题", "内容", "", "https://github.com/cclink"), new ShareListener() {
                    @Override
                    public void onComplete() {

                    }

                    @Override
                    public void onCancel() {

                    }

                    @Override
                    public void onError(ShareError shareError) {

                    }
                });
            }
        });
    }
}

@@ -160,16 +160,127 @@
 utton;%0A%0A
+import java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0A%0A
 import c
@@ -308,16 +308,16 @@
 areApi;%0A
-
 import c
@@ -524,24 +524,100 @@
 Activity %7B%0A%0A
+    private static String FILE_NAME = %22share.png%22;%0A    private File mFile;%0A%0A
     @Overrid
@@ -1031,10 +1031,20 @@
 orm.
-QQ
+SYSTEM_SHARE
 , ne
@@ -1074,10 +1074,31 @@
 %E5%AE%B9%22, 
-%22%22
+mFile.getAbsolutePath()
 , %22h
@@ -1491,32 +1491,32 @@
 ;%0A            %7D%0A
-
         %7D);%0A    
@@ -1506,21 +1506,1363 @@
 %0A        %7D);
+%0A%0A        // %E7%94%B1%E4%BA%8E%E9%9C%80%E8%A6%81%E5%B0%86%E5%9B%BE%E7%89%87%E8%B7%AF%E5%BE%84%E4%BC%A0%E9%80%92%E7%BB%99%E5%A4%96%E9%83%A8app%EF%BC%8C%E8%80%8C%E5%A4%96%E9%83%A8app%E6%B2%A1%E6%9C%89%E8%AE%BF%E9%97%AEassets%E4%B8%8B%E6%96%87%E4%BB%B6%E7%9A%84%E6%9D%83%E9%99%90%EF%BC%8C%0A        // %E6%89%80%E4%BB%A5%E8%BF%99%E9%87%8C%E5%B0%86assets%E4%B8%AD%E7%9A%84share.png%E5%A4%8D%E5%88%B6%E5%88%B0/storage/emulated/0/Android/data/cnx.cclink.unishare.demo/cache%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%AD%EF%BC%8C%E4%BB%A5%E4%BE%BF%E5%88%86%E4%BA%AB%E7%9A%84%E6%97%B6%E5%80%99%E4%BD%BF%E7%94%A8%0A        File cacheDir = getExternalCacheDir();%0A        if (cacheDir != null) %7B%0A            String fileName = cacheDir.getAbsolutePath() + File.separator + FILE_NAME;%0A            mFile = new File(fileName);%0A            if (!mFile.exists()) %7B%0A                new Thread(new Runnable() %7B%0A                    @Override%0A                    public void run() %7B%0A                        try %7B%0A                            InputStream inStream = getAssets().open(%22share.png%22);%0A                            FileOutputStream outStream = new FileOutputStream(mFile);%0A                            byte%5B%5D buffer = new byte%5B1444%5D;%0A                            int byteread;%0A                            while ( (byteread = inStream.read(buffer)) != -1) %7B%0A                                outStream.write(buffer, 0, byteread);%0A                            %7D%0A                            outStream.flush();%0A                            outStream.close();%0A                            inStream.close();%0A                        %7D catch (IOException e) %7B%0A                            e.printStackTrace();%0A                        %7D%0A                    %7D%0A                %7D).start();%0A            %7D%0A        %7D
 %0A    %7D%0A%7D%0A

修改测试代码，增加图片