调用本地新浪微博客户端分享内容到微博

不用OAuth认证!

不用下载新浪微博SDK!

不用写复杂的代码!

十几行代码,直接分享!

你没有听错!

你没有听错!

private void share(){
    	Intent intent=new Intent(Intent.ACTION_SEND);   
        intent.setType("image/*");   
        intent.putExtra(Intent.EXTRA_TEXT, "文本");    
        intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/aaa.jpg")));    
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
		
		Context context = null;
		
		try{
			context=createPackageContext("com.sina.weibo", Context.CONTEXT_IGNORE_SECURITY);
			intent.setClassName(context, "com.sina.weibo.EditActivity");  
			
			startActivity(intent);
		}catch (ActivityNotFoundException  e){
			Toast.makeText(getApplicationContext(), "您的手机没有安装新浪微博客户端", Toast.LENGTH_LONG).show();
		} catch (NameNotFoundException e) {
			e.printStackTrace();
		}
    }
原文地址:https://www.cnblogs.com/ihou/p/2650639.html