我已经实现了图像的幻灯片功能,现在需要将当前页面设置为电子邮件的正文并在 phonegap 中共享。我可以发送电子邮件但不能发送图像,我可以将第一张图像设置为当前页面并设置路径吗?请帮助我为滑动图像提供正确的路径。
这是我的 Java 意图代码
private void doSendIntent(String subject, String text) {
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, text);
this.cordova.startActivityForResult(this, sendIntent, 0);
File path = new File(Environment.getExternalStorageDirectory()+"file_path");
sendIntent.putExtra(android.content.Intent.EXTRA_STREAM,Uri.fromFile(new File(path.getAbsolutePath())));
}
已经在 javascript 中实现了图像滑动。
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide red-slide">
<img src="images/v2.jpg" >
<div class="wrapper">
<button class="button" id="Email" onclick="share()">Hello</button> </div>
</div>
<div class="swiper-slide blue-slide">
<img src="images/v.jpg" >
<div class="wrapper">
<button class="button" id="Email" onclick="share()">Hello</button>
</div>
</div>
<div class="pagination"></div>
</div>
<script>
var mySwiper = new Swiper('.swiper-container',{
pagination: '.pagination',
paginationClickable: true
})
</script>