2016-11-18 3 views
0

와 데이터를 공유하기. .. "). 나머지 데이터는 어떻게 얻을 수 있습니까? 이미지, 제목, 설명 및 웹 사이트 주소는 어떻게됩니까?내가 WhatsApp에에서 같은 내 응용 프로그램에 데이터를 공유하고 싶은 사진 및 텍스트

Intent intent = getIntent(); 
String action = intent.getAction(); 
String type = intent.getType(); 
if (Intent.ACTION_SEND.equals(action) && type != null) { 
     if ("text/plain".equals(type)) { 
      sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); 
     } else if (type.startsWith("image/")) { 
      handleSendImage(intent); // Handle single image being sent 
     } 
} else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && type != null) { 
     if (type.startsWith("image/")) { 
      handleSendMultipleImages(intent); 
     } 
} 

난 단지 EXTRA_TEXT와 ACTION_SEND를 얻을.

+0

이미지는 공유 한 링크에서 추가됩니다. –

+0

@KirankumarZinzuvadia 그래서 백엔드에서 링크를 샘플링하고 수동으로 만들 수 있습니까? – user1787773

답변

0

이미지를 의도적으로 스트리밍하여 이미지를 공유 할 수 있습니다. 하지만 주로 공유하는 이미지 스트림 공유를 지원할지 여부를 선택하는 응용 프로그램에 따라 다릅니다.

Intent shareIntent = new Intent(Intent.ACTION_SEND); 
shareIntent.setType("image/jpg"); 
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(photoFile)); 
startActivity(Intent.createChooser(shareIntent, "Share image using")); 

공유 옵션에 대한 아이디어를 얻으려면이 링크를 선택하십시오.

https://guides.codepath.com/android/Sharing-Content-with-Intents

그리고 다른 응용 프로그램에서 공유 데이터가이 링크를 확인받을 : 내가 말을했던 방법은 백엔드에있는 링크 메타 데이터 태그를 구문 분석하는 것입니다 https://developer.android.com/training/sharing/receive.html

+0

감사하지만 다른 앱에서 데이터를 보내지 않으려 고합니다. – user1787773

+0

@ user1787773 업데이트 된 답변 확인 –

관련 문제