I want to open Android Wear Start Screen (the one with red G icon and text 'Speak Now') from my app. Is this possible?
thanks. w
I want to open Android Wear Start Screen (the one with red G icon and text 'Speak Now') from my app. Is this possible?
thanks. w
It's not possible to launch this exact screen (no API for that).
However you can easily recreate a similar screen yourself.
This code lists the activities available in the launcher:
final PackageManager packageManager = getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> resInfos = packageManager.queryIntentActivities(intent, 0);
//using hashset so that there will be no duplicate packages,
//if no duplicate packages then there will be no duplicate apps
HashSet<String> packageNames = new HashSet<String>(0);
List<ApplicationInfo> appInfos = new ArrayList<ApplicationInfo>(0);
//getting package names and adding them to the hashset
for(ResolveInfo resolveInfo : resInfos) {
packageNames.add(resolveInfo.activityInfo.packageName);
}
//now we have unique packages in the hashset, so get their application infos
//and add them to the arraylist
for(String packageName : packageNames) {
try {
appInfos.add(packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA));
} catch (NameNotFoundException e) {
//Do Nothing
}
}
//to sort the list of apps by their names
Collections.sort(appInfos, new ApplicationInfo.DisplayNameComparator(packageManager));
Then show the elements in appInfos
into a WearableListView.