`
libo19881179
  • 浏览: 266974 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

【so easy~】 Intent实现 <分享>功能!~

阅读更多

http://androiddada.iteye.com/

Intent intent = new Intent(Intent.ACTION_SEND);
				intent.setType("text/plain"); // 分享的数据类型
				intent.putExtra(Intent.EXTRA_SUBJECT, "我的分享"); // 主题
				intent.putExtra(Intent.EXTRA_TEXT, "分享内容:"); // 内容
				startActivity(Intent.createChooser(intent, "title")); // 目标应用选择对话框的标题

 把以上代码放到 分享按钮的监听里,就ok了

两个参数分别设置分享的主题 和 内容

这是最简单的调用当前用户系统的接口进行分享,比如,用户装了新浪微博的应用,就会显示在分享方式里,但如果想实现指定的分享功能,就必须自己写相应的微博分享的代码了~要参考每个微博的api

http://androiddada.iteye.com/

2
1
分享到:
评论

相关推荐

    Android代码-Android-Ultra-Photo-Selector

    Select images from Android devices made easy :-) In preview you can also Zoom images. You can select images from different albums. I am using UIL, so you can configure image caching your own way, if ...

    android实现记住用户名和密码以及自动登录

    由于xml文件内容,就不展现在这了,自己写一写就好,爸妈再也不用担心我的学习了,so easy package com.sdufe.login; import android.app.Activity; import android.content.Context; import android.content....

    Apress.Android.Apps.for.Absolute.Beginners.2nd.edition

    Anybody can start building simple apps for the Android platform, and this book will show you how! Recently updated to include Android ...Understanding Intents and Intent Filters Advanced Android Topics

    a project model for the FreeBSD Project.7z

    Ingvil Hovig &lt;ingvil.hovig@skatteetaten.no&gt; Jesper Holck&lt;jeh.inf@cbs.dk&gt; John Baldwin &lt;jhb@freebsd.org&gt; John Polstra &lt;jdp@freebsd.org&gt; Kirk McKusick &lt;mckusick@freebsd.org&gt; Mark Linimon &lt;linimon@...

    Sakemail

    Change the generator of the message id.- Added the field MessageId and InReplyTo to the TSakMsg component.- Added the field In-Reply-To that is added to the message generated when it is &lt;&gt; ...

    Learning Functional Programming in Go-Packt Publishing(2017).pdf

    Expressive code: FP allows us to concisely express business intent in our code. We declare what our functions do, without the clutter of error checking after every function call, and without having to...

    The Language of SQL(Addison,2ed,2016)

    Design relational databases so that data retrieval is easy and intuitive Use spreadsheets to transform your data into meaningful displays Retrieve data from multiple tables via joins, subqueries, ...

    Universal-USB-Installer

    want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is ...

    The.Language.of.SQL.2nd.Edition.0134658256

    Design relational databases so that data retrieval is easy and intuitive Use spreadsheets to transform your data into meaningful displays Retrieve data from multiple tables via joins, subqueries, ...

    fat-tailed and skewed asset return distributions

    Students find it easy to understand and apply the normal distribution: Give them the expected value and standard deviation and probability statements about outcomes can be easily made. Moreover, even ...

    微软内部资料-SQL性能优化2

    A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads, and so on. Memory Concepts (X86 Address Space) Per Process Address Space Every process ...

Global site tag (gtag.js) - Google Analytics