..
lblshare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String valueofpathh = recordName.getText().toString();
File filee = new File(valueofpathh);
try {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setType("audio/*");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(filee));
startActivity(sendIntent);
} catch (NoSuchMethodError | IllegalArgumentException | NullPointerException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
});
난 당신이 이해의 도움을 바랍니다.
여기 valueOfPath는 내 장치 sdcard 폴더 경로가 포함 된 문자열이므로 해당 경로에서 모든 오디오 파일을 가져올 수 있습니다.
당신이 의도 유형 변경 한 후 전송하는 경우에만 메시지 파일이있는 경우 :
send message through whatsapp
:이 링크를보고
sendIntent.setType("text/plain");
시도