public static @Nullable UserGuide initializeIfNeeded(final Activity activity, final LifecycleOwner lifecycle_owner, final AppListViewModel vm) {
		final Scopes.Scope scope = Scopes.app(activity);

		final boolean action_tips_pending = anyActionTipPending(scope);
		if (! action_tips_pending) return null;
		final UserGuide guide = new UserGuide(activity, scope);

		guide.mAppListViewModel = vm;
		vm.mSelection.observe(lifecycle_owner, selection -> guide.mAppSelection = selection);
		final IslandAppListProvider provider = IslandAppListProvider.getInstance(activity);
		provider.registerObserver(new AppListProvider.PackageChangeObserver<IslandAppInfo>() {
			@Override public void onPackageUpdate(final Collection<IslandAppInfo> apps) {
				if (apps.size() != 1) return;		// Batch update is never triggered by user interaction.
				final IslandAppInfo app = apps.iterator().next();
				if (app.isHidden())
					scope.markOnly(SCOPE_KEY_TIP_FREEZE);		// User just froze an app, no need to show tip for app freezing.
				else if (Users.isProfileManagedByIsland(app.user) && app.getLastInfo() == null)
					scope.markOnly(SCOPE_KEY_TIP_CLONE);		// User just cloned an app, no need to show tip for app cloning.
				if (scope.isMarked(SCOPE_KEY_TIP_FREEZE) && scope.isMarked(SCOPE_KEY_TIP_CLONE))
					provider.unregisterObserver(this);			// No more interest for package events.
			}

			@Override public void onPackageRemoved(final Collection<IslandAppInfo> apps) {}
		});
		return guide;
	}
Helper for manipulate user guide menu

Created by Oasis on 2017/3/14.
mobile/src/main/java/com/oasisfeng/island/guide/UserGuide.java