Android, как отправить несколько контактов прикрепляются в одном файле .vcf и отправлять на почту?

В моем приложении несколько контактов привязаны к одному.vcf файл и этот файл, отправленный на почту, попробуйте показать все данные о контактах в журнале cat, но не можете отправить все данные, прикрепленные к одному файлу .vcf?

У кого-нибудь есть идеи относительно этого, помогите мне, пожалуйста.

вот мой код

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);  

    vCard = new ArrayList();                 

    Log.i("TAG one", "vfile" +vfile);
    vfile = "Contacts" + "_" + System.currentTimeMillis() + ".vcf";  

    /**
     * This Function For Vcard And here i take one Array List in Which i
     * store every Vcard String of Every Contact Here i take one Cursor and
     * this cursor is not null and its count>0 than i repeat one loop up to
     * cursor.getcount() means Up to number of phone contacts. And in Every
     * Loop i can make vcard string and store in Array list which i declared
     * as a Global. And in Every Loop i move cursor next and print log in
     * logcat.
     * */
    getVcardString();           
}       

private void getVcardString() { 

    cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
    Log.i("TAG two", "cursor" +cursor);
    if (cursor != null && cursor.getCount() > 0) {
        cursor.moveToFirst();
        Log.i("Number of contacts", "cursorCount" +cursor.getCount());          

        for (int i = 0; i < cursor.getCount(); i++) {                       
            get(cursor);                    
            Log.i("TAG send contacts",  "Contact " + (i + 1) + "VcF String is" +  vCard.get(i));                     
            cursor.moveToNext();                                        
        }           

        StringBuffer s = new StringBuffer();
        s.append( vCard.toString());                
        string = s.toString();                           
        file = new File(string);        

    //  Log.i("s", ""+s);   
    //  Log.i("string", ""+string); 
        Log.i("file", ""+file);             

    } else {
        Log.i("TAG", "No Contacts in Your Phone");
    }        
}       

public void get(Cursor cursor) {

    String lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
    Log.i("lookupKey", ""+lookupKey);
    Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey);     

    try {
        AssetFileDescriptor fd = this.getContentResolver().openAssetFileDescriptor(uri, "r");          

        FileInputStream fis = fd.createInputStream();
        byte[] buf = new byte[(int) fd.getDeclaredLength()];
        fis.read(buf);
        String vcardstring= new String(buf);          

        String storage_path = Environment.getExternalStorageDirectory().toString() + File.separator + vfile;
        FileOutputStream mFileOutputStream = new FileOutputStream(storage_path, true);
        mFileOutputStream.write(vcardstring.toString().getBytes());

        vCard.add(storage_path);            

    } catch (Exception e1)  {            
        e1.printStackTrace();
    }
}       

private void data() {       

    File filelocation = file;     
    Intent sharingIntent = new Intent(Intent.ACTION_SEND);
    sharingIntent.setType("vnd.android.cursor.dir/email");      
    sharingIntent.setType("application/x-vcard");             
    sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+filelocation));
    startActivity(Intent.createChooser(sharingIntent, "Send email"));            
}
}    

Ответы на вопрос(2)

Ваш ответ на вопрос