呼叫android手機微博客戶端傳送微博

2021-05-27 11:49:54 字數 2090 閱讀 1383

用隱式意圖開啟android手機中安裝的微博客戶端傳送微博。

editactivity中的oncreate方法中重要**

private void onlauchmodechanged(lauchmode paramlauchmode) 如果我們用的是android.intent.action.send即lauchmode.share;

if ((!sudroid.textutils.isemptyorblank(str1)) && (str1.equals("android.intent.action.send")))

paramlauchmode = lauchmode.share;

str2 = getintent().getstringextra("android.intent.extra.text");

if (!android.text.textutils.isempty(str2))

loadshareimage();

文字資訊已經在editactivity中顯示出來了 接下來要loadshareimage了

protected void loadshareimage()

獲取到uri之後就要 displayimageuri

private void displayimageuri(uri paramuri)

displayinsertbitmap();

}

如果bitmap存在就displayinsertbitmap

bitmap localbitmap = this.mimageloadinghelper.createthumbnail();

localimageview1.setimagebitmap(localbitmap);

就展示在editactivity中了

以上資訊我們就可以寫出呼叫editactivity的隱式意圖了。

intent intent = new intent("android.intent.action.send");

intent.settype("image/*");

intent.putextra(intent.extra_subject, "分享");

intent.putextra(intent.extra_text, "終於可以了!!!");

intent.putextra(intent.extra_stream,uri.parse("file:sdcard"));

intent.setflags(intent.flag_activity_new_task);

startactivity(intent.createchooser(intent, gettitle()));

當傳送完微博后,我放到sdcard中的會消失。也就是這張//sdcard

Android 手機定位呼叫方法

android手機定位在中國還是有些坑的。首先android的定位方式分為三種 gps,net work,passive 具體問題 見 1.獲取定位管理服務 locationmanager mglocation locationmanager mainactivity.this.getsystems...

部落格 微博和手機新聞爆料

部落格這玩意兒登入中國也有十來年了吧?從最早的只是少數人的私有空間 到現在的全民皆 博 如今各類門戶 上如果不提供部落格功能的話,那無疑真是out了。無論是影響力驚人的韓寒 老徐等江湖大蝦,還是到籍籍無名的草根小蝦公尺,部落格已然成為大家抒發感想 分享觀點 表達感受的 根據地 就算是客似雲來也好 門...

監聽Android手機的呼叫狀態

telephonymanager作為乙個service介面提供給使用者查詢 相關的內容,比如imei,linenumber1等。通過下面的 即可獲得telephonymanager的例項。telephonymanager mtelephonymgr telephonymanager this get...