android intent使用定义标题
程序员文章站
2023-12-05 17:24:40
可以使用 intent.createchooser() 的方法来创建 intent,并传入想要的 sting 作为标题。 以wallpaper 选择框为例,当在launch...
可以使用 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中
以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中
下一篇: HTML5中新标签和常用标签详解
推荐阅读
-
android intent使用定义标题
-
Android开发使用自定义view实现ListView下拉的视差特效功能
-
Android 自定义标题栏 显示网页加载进度的方法实例
-
使用Android自定义控件实现滑动解锁九宫格
-
Android编程实现使用Intent传输包含自定义类的ArrayList示例
-
Android中BroadcastReceiver(异步接收广播Intent)的使用
-
Android使用xml自定义图片实例详解
-
Android 使用自定义RecyclerView控件实现Gallery效果
-
Android中使用ListView绘制自定义表格技巧分享
-
Android自定义Spinner下拉列表(使用ArrayAdapter和自定义Adapter实现)