android intent服务器,android intent使用自定义标题

可以使用 Intent.createChooser() 的方法来创建 Intent,并传入想要的 Sting 作为标题。

以wallpaper 选择框为例,当在Launcher workspace的空白区域上长按,会弹出wallpaper的选择框,选择框的标题为”Choose wallpaper from”,如下:

复制代码 代码如下:

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对应的字串内容就是”Choose wallpaper from”,定义在Launcher2的Strings.xml中

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值