2013-03-05 1 views
0

이미지를 드로어 블 폴더에 넣고 gridview.Also에서 해당 이미지를 얻고 있습니다. 풀 스크린 이미지를 선택하고 있습니다. 이제 이미지 첨부로 MMS를 보내려고합니다.이미지가있는 MMS를 보내려면

다음은 이미지를 표시하는 코드입니다. 그리고 Uri에게 의도를 부여하거나 이미지 첨부 파일을 보내는 방법을 MMS로 보내주십시오.

imageView.setImageResource(imageAdapter.mThumbIds[position]); 



Intent sendIntent = new Intent(Intent.ACTION_SEND); 
      sendIntent.putExtra("sms_body", "Hii"); 
      sendIntent.setType("image/png"); 

      startActivity(sendIntent); 
+0

무슨 문제? – itsrajesh4uguys

+0

이것을보십시오 ..http : //jtribe.blogspot.in/2008/12/sending-mms-with-android.html – itsrajesh4uguys

+0

경로 또는 Uri를 인 텐트에 추가하는 방법 sendIntent.putExtra (Intent. EXTRA_STREAM, Uri.fromFile (새 파일 (targetPath))); 하지만 나는 drawable에서 그것을 원한다 – user1758835

답변

0

다음 코드를 사용하여 mms를 보냅니다.이 도움이 도움이 되길 바랍니다.

Intent intent = new Intent(Intent.ACTION_SEND); 
    intent.putExtra("sms_body", "Hi how are you"); 
    intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/file.gif"))); 
    intent.setType("image/gif"); 
    startActivity(Intent.createChooser(intent,"Send")); 



Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name"); 

편집 :

Intent intent = new Intent(Intent.ACTION_SEND); 
     intent.putExtra("sms_body", "Hi how are you"); 
     Uri uri = Uri.parse("android.resource:// com.example.stack/drawable/ic_launcher.png"); 
     intent.putExtra(Intent.EXTRA_STREAM,uri); 
     intent.setType("image/png"); 
     startActivity(Intent.createChooser(intent,"Send")); 
+0

나는 sdcard와 그 작업에 대해서도 알고 있지만, imageAdapter.mThumbIds [위치] – user1758835

+0

에서 얻고있는 resourse id의 도움으로 drawable에서 그 경로를 얻는 방법을 알고 있습니다. 수정 된 게시물? – itsrajesh4uguys

+0

그래서 우리는 그 의도를 전달해야합니다. 퍼스트 엑스트라 (uri)? – user1758835