簡體   English   中英

來自應用程序Android的簡單推文

[英]Simple Tweet from the app Android

如何通過應用設置簡單的Tweet。 登錄必須通過twitter網站。 用戶甚至必須填寫任何文本。 我只需要發推文。 請提供示例。

以下代碼應為您提供幫助:

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(
  android.content.Intent.EXTRA_TEXT,
  "I'm a string that you want to tweet);
startActivity(
  Intent.createChooser(shareIntent, getString(R.string.share_via)));

這實際上是通用共享代碼。 它將獲得所有可以處理“發送操作”的應用程序(例如Facebook,Twitter,電子郵件等),並讓用戶選擇要使用的應用程序。 這是您通常在android應用上的“共享”按鈕中看到的功能類型。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM