@@ -0,0 +1,1924 @@
+/* Copyright 2020 Braden Farmer%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.farmerbb.taskbar.activity;%0A%0Aimport android.content.Intent;%0Aimport android.content.SharedPreferences;%0Aimport android.os.Bundle;%0Aimport androidx.localbroadcastmanager.content.LocalBroadcastManager;%0A%0Aimport com.farmerbb.taskbar.util.AppEntry;%0Aimport com.farmerbb.taskbar.util.DesktopIconInfo;%0Aimport com.farmerbb.taskbar.util.U;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0A%0Apublic class DesktopIconSelectAppActivity extends AbstractSelectAppActivity %7B%0A%0A    private DesktopIconInfo desktopIcon;%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        desktopIcon = (DesktopIconInfo) getIntent().getSerializableExtra(%22desktop_icon%22);%0A    %7D%0A%0A    @Override%0A    public void selectApp(AppEntry entry) %7B%0A        desktopIcon.entry = entry;%0A%0A        try %7B%0A            SharedPreferences pref = U.getSharedPreferences(this);%0A            JSONArray icons = new JSONArray(pref.getString(%22desktop_icons%22, %22%5B%5D%22));%0A            icons.put(desktopIcon.toJson(this));%0A%0A            pref.edit().putString(%22desktop_icons%22, icons.toString()).apply();%0A            LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(%22com.farmerbb.taskbar.REFRESH_DESKTOP_ICONS%22));%0A        %7D catch (JSONException e) %7B /* Gracefully fail */ %7D%0A%0A        finish();%0A    %7D%0A%7D

Integrate the Persistent Shortcuts app into Taskbar (2 of 2)