ShareSDK.initSDK(context);
ShareParams sp = new ShareParams();
sp.setTitle("新浪分享");
sp.setText( "新浪分享测试文本");
sp.setTitleUrl("http://www.paotui.com");
sp.setSite("发布分享的网站名称");
sp.setSiteUrl("发布分享网站的地址");
Platform sinaWeibo = ShareSDK.getPlatform(context, SinaWeibo.NAME);
sinaWeibo.setPlatformActionListener(new PlatformActionListener() {
@Override
public void onError(Platform arg0, int arg1, Throwable arg2) {
// TODO Auto-generated method stub
Log.i("onError", "Platform:"+arg0+":arg1:"+arg1+":Throwable:"+arg2);
}
@Override
public void onComplete(Platform arg0, int arg1, HashMap<String, Object> arg2) {
// TODO Auto-generated method stub
Log.i("onComplete", "Platform:"+arg0+":arg1:"+arg1+":HashMap:"+arg2);
}
@Override
public void onCancel(Platform arg0, int arg1) {
// TODO Auto-generated method stub
Log.i("onCancel", "Platform:"+arg0+":arg1:"+arg1);
}
});
sinaWeibo.share(sp);
报下列错误
07-28 09:45:38.096: E/AndroidRuntime(1027): FATAL EXCEPTION: main
07-28 09:45:38.096: E/AndroidRuntime(1027): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kuangcheng.errands/cn.sharesdk.framework.ShareSDKUIShell}: android.content.res.Resources$NotFoundException: String resource ID #0x0
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.app.ActivityThread.access$600(ActivityThread.java:130)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.os.Looper.loop(Looper.java:137)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.app.ActivityThread.main(ActivityThread.java:4745)
07-28 09:45:38.096: E/AndroidRuntime(1027): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 09:45:38.096: E/AndroidRuntime(1027): at java.lang.reflect.Method.invoke(Method.java:511)
07-28 09:45:38.096: E/AndroidRuntime(1027): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-28 09:45:38.096: E/AndroidRuntime(1027): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-28 09:45:38.096: E/AndroidRuntime(1027): at dalvik.system.NativeStart.main(Native Method)
07-28 09:45:38.096: E/AndroidRuntime(1027): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.content.res.Resources.getText(Resources.java:229)
07-28 09:45:38.096: E/AndroidRuntime(1027): at android.widget.TextView.setText(TextView.java:3620)
res下的资源缺失,请仔细核对或者重新集成下。