如何通过我的Android应用程序在Pinterest中与Image共享/固定消息
作者:互联网
我正在尝试将Pinterest集成到我的Android应用程序中并使用image固定/共享消息.但我没有办法做任何事情.
我下载了Pinterest SDK并在我的项目中添加了jar文件.
以下是我的代码snnipet.
PinIt pinIt = new PinIt();
PinIt.setPartnerId("My ID");
pinIt.setUrl("http://placekitten.com/400/300");
pinIt.setImageUrl(m_cObjSocialTable.getPinterestImagePath());
pinIt.setDescription(pMessage);
pinIt.setListener(new PinItListener() {
@Override
public void onStart() {
super.onStart();
}
@Override
public void onComplete(boolean completed) {
super.onComplete(completed);
if (completed) {
System.out.println("Pinit complete");
}
}
@Override
public void onException(Exception e) {
super.onException(e);
System.out.println("Pinit Exception");
}
});
pinIt.doPinIt(this);
但它没有发布,在onComplete()中我们变得虚假.
请帮帮我
谢谢&问候
Tiru
解决方法:
IntentBuilder lIntentBuilder = ShareCompat.IntentBuilder.from(this);
Uri lPictureUri = null;
lPictureUri = Uri.fromFile(new File("mnt/sdcard/1.jpg"));
lIntentBuilder.setStream(lPictureUri);
String lType = null != lPictureUri ? "image/jpeg" : "text/plain";
lIntentBuilder.setType(lType);
lIntentBuilder.setText("My Description");
Intent shareIntent = lIntentBuilder.getIntent().setPackage("com.pinterest");
shareIntent.putExtra("com.pinterest.EXTRA_DESCRIPTION", "Messagessssssssss");
startActivity(shareIntent)
标签:android,android-intent,pinterest,socialshare,pin-it-sdk 来源: https://codeday.me/bug/20190612/1226848.html