SoFunction
Updated on 2025-03-04

Android intent use definition title

You can use the () method to create an Intent and pass the desired Sting as the title.

Taking the wallpaper selection box as an example, when you hold on the blank area of ​​the Launcher workspace, the selection box of the wallpaper will pop up. The title of the selection box is "Choose wallpaper from", as follows:
Copy the codeThe code is as follows:

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

Among them, the string content corresponding to .chooser_wallpaper is "Choose wallpaper from", which is defined in Launcher2