protected T putApp(final String pkg, final T app) {
		final T old_app_vm = mAppsByPackage.put(pkg, app);
		if (old_app_vm != null) {
			Log.d(TAG, "Update in place: " + pkg);
			final int index = mApps.indexOf(old_app_vm);
			mApps.updateItemAt(index, app);
			if (mSelection.getValue() == old_app_vm) setSelection(app);	// Keep the selection unchanged
		} else {
			Log.d(TAG, "Put: " + pkg);
			mApps.add(app);
		}
		return app;
	}
View-model of basic entry-selectable (single-choice) app-list.

Created by Oasis on 2016/6/24.
mobile/src/main/java/com/oasisfeng/common/app/BaseAppListViewModel.java