打开官方的HelloH5的DEMO也带不过来。系统分享和NATIVE调用都带不过来。
IdeaPlayer
- 发布:2015-08-17 12:32
- 更新:2015-10-23 13:34
- 阅读:5281
最佳回复
android版的话,用NATIVE可以带文字和多图分享!
function test_weixin_share_mul_pic(ex, pics, description){
var Intent = plus.android.importClass('android.content.Intent');
var ComponentName = plus.android.importClass('android.content.ComponentName');
var ArrayList = plus.android.importClass('java.util.ArrayList');
var Uri = plus.android.importClass('android.net.Uri');
var Environment = plus.android.importClass('android.os.Environment');
var File = plus.android.importClass('java.io.File');
//var sdcardDir = plus.android.invoke(Environment.getExternalStorageDirectory(),'getAbsolutePath');
var intent = new Intent();
var localComponentName = new ComponentName("com.tencent.mm", ex);
intent.setComponent(localComponentName);
intent.setAction("android.intent.action.SEND_MULTIPLE");
intent.setType("image/");
var localArrayList = new ArrayList();
for(var i =0;i< pics.length;i++){
var filePath = pics[i]; //sdcardDir +
//console.log('filePath=' + filePath);
localArrayList.add(Uri.fromFile(new File(filePath)));
}
intent.putParcelableArrayListExtra("android.intent.extra.STREAM", localArrayList);
intent.putExtra("Kdescription", description);
var act = plus.android.runtimeMainActivity();
act.startActivity(intent);
}