Reputation: 23
As part of an app I'm working on, I'd like to programmatically open the watch face picker on an Android Wear watch (typically achieved by long-pressing on the current watch face). Note that I'm not trying to programmatically change the watch face, but just open the picker so that the user can choose a new watch face.
I'm familiar with using intents to start activities in Android, and I believe I need to do something like this:
Intent intent = new Intent("???");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
I just don't know what to substitute in for "???" in the code above.
Upvotes: 2
Views: 936
Reputation: 5491
Intent intent = new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
startActivity(intent);
See WallpaperManager
Upvotes: 3
Reputation: 42188
Watch faces are just specialized wallpapers, so you can use all the Android facilities that are available for wallpapers. In this case you want to use Intent.ACTION_SET_WALLPAPER
like this:
Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));
Upvotes: 0