diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 6c583974..56760642 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -218,6 +218,9 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect case R.id.close_article: closeArticle(); return true; + case R.id.share_article: + shareArticle(m_selectedArticle); + return true; case R.id.show_feeds: if (getUnreadOnly()) { item.setTitle(R.string.menu_unread_feeds); @@ -232,6 +235,18 @@ public class MainActivity extends Activity implements FeedsFragment.OnFeedSelect } } + public void shareArticle(Article article) { + if (article != null) { + Intent intent = new Intent(Intent.ACTION_SEND); + + intent.setType("text/plain"); + intent.putExtra(Intent.EXTRA_SUBJECT, article.title); + intent.putExtra(Intent.EXTRA_TEXT, article.link); + + startActivity(Intent.createChooser(intent, getString(R.id.share_article))); + } + } + public void closeArticle() { findViewById(R.id.article_fragment).setVisibility(View.GONE); findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);