2012-03-31 3 views
3

아래 코드를 사용하여 한 장치에서 다른 장치로 파란 치아를 통해 파일을 보냅니다. 같은 시간에 여러 파일을 보내고 싶습니다. 누구든지 파일을 여러 URI를 구문 분석하는 방법을 안내 할 수 있습니다. 문자열 tokenizer 및 루프 동안 있지만 그 경우, 기본 파란색 치아 요청을 두 번 오는 있습니다. 파싱하는 파일이 2 개있는 경우).블루투스를 통해 여러 파일 보내기

StringTokenizer tokens = new StringTokenizer(music, ","); 

    String stored = ""; 
    while (tokens.hasMoreTokens()) { 

     stored = tokens.nextToken(); 


     File file = new File(stored); 
     Log.d("file===", stored); 

     intentfile = new Intent(); 
     intentfile.setAction(android.content.Intent.ACTION_SEND); 

     intentfile.setType("video/*"); 

     intentfile.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); 
     startActivityForResult(intentfile, SEND_REQUEST); 


    } 

답변

1

여러 개의 파일을 전송 (또는 공유)하는 setAction(Intent.ACTION_SEND_MULTIPLE) 대신 setAction(Intent.ACTION_SEND) 사용합니다.

6 개월 전 질문을 받았으므로 지금 당신과 얼마나 관련이 있는지 모르겠습니다. 그러나 다른 사람을 도울 수 있습니다. :)

관련 문제