欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

android intent使用定義標(biāo)題

 更新時(shí)間:2012年11月23日 15:38:22   作者:  
本文將詳細(xì)介紹android怎樣自定義Intent選擇界面的標(biāo)題,提供相關(guān)參考方法
可以使用 Intent.createChooser() 的方法來創(chuàng)建 Intent,并傳入想要的 Sting 作為標(biāo)題。

以wallpaper 選擇框?yàn)槔?,?dāng)在Launcher workspace的空白區(qū)域上長按,會(huì)彈出wallpaper的選擇框,選擇框的標(biāo)題為”Choose wallpaper from”,如下:
復(fù)制代碼 代碼如下:

private void startWallpaper() {
showWorkspace(true);
final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
Intent chooser = Intent.createChooser(pickWallpaper, getText(R.string.chooser_wallpaper));
// NOTE: Adds a configure option to the chooser if the wallpaper supports it
startActivityForResult(chooser, REQUEST_PICK_WALLPAPER);
}

其中,R.string.chooser_wallpaper對應(yīng)的字串內(nèi)容就是”Choose wallpaper from”,定義在Launcher2的Strings.xml中

相關(guān)文章

最新評論