|
4 | 4 |
|
5 | 5 | import android.app.ActivityManager; |
6 | 6 | import android.content.Context; |
| 7 | +import android.content.DialogInterface; |
7 | 8 | import android.graphics.Color; |
8 | 9 | import android.graphics.drawable.ColorDrawable; |
9 | 10 | import android.text.TextUtils; |
@@ -158,22 +159,6 @@ public void onItemClick(AdapterView<?> adapterView, View view, int position, lon |
158 | 159 | data.selectionState = !data.selectionState; |
159 | 160 | config.setShowFingerprintIcon(data.selectionState); |
160 | 161 | mListAdapter.notifyDataSetChanged(); |
161 | | - if (Constant.PACKAGE_NAME_QQ.equals(context.getPackageName())) { |
162 | | - config.commit(); |
163 | | - ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
164 | | - List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = am.getRunningAppProcesses(); |
165 | | - for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcesses) { |
166 | | - if ("com.tencent.mobileqq:tool".equals(processInfo.processName)) { |
167 | | - android.os.Process.killProcess(processInfo.pid); |
168 | | - try { |
169 | | - Runtime.getRuntime().exec(new String[]{"kill", "-9", String.valueOf(processInfo.pid)}); |
170 | | - } catch (IOException e) { |
171 | | - L.e(e); |
172 | | - } |
173 | | - } |
174 | | - L.d("processInfo", processInfo.processName, processInfo.pid); |
175 | | - } |
176 | | - } |
177 | 162 | } else if (Lang.getString(R.id.settings_title_password).equals(data.title)) { |
178 | 163 | PasswordInputView passwordInputView = new PasswordInputView(context); |
179 | 164 | if (!TextUtils.isEmpty(config.getPassword())) { |
@@ -220,4 +205,26 @@ private boolean checkPasswordAndNotify(Context context) { |
220 | 205 | } |
221 | 206 | return true; |
222 | 207 | } |
| 208 | + |
| 209 | + @Override |
| 210 | + public void onDismiss(DialogInterface dialogInterface) { |
| 211 | + Context context = getContext(); |
| 212 | + if (Constant.PACKAGE_NAME_QQ.equals(context.getPackageName())) { |
| 213 | + Config.from(context).commit(); |
| 214 | + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); |
| 215 | + List<ActivityManager.RunningAppProcessInfo> runningAppProcesses = am.getRunningAppProcesses(); |
| 216 | + for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcesses) { |
| 217 | + if ("com.tencent.mobileqq:tool".equals(processInfo.processName)) { |
| 218 | + android.os.Process.killProcess(processInfo.pid); |
| 219 | + try { |
| 220 | + Runtime.getRuntime().exec(new String[]{"kill", "-9", String.valueOf(processInfo.pid)}); |
| 221 | + } catch (IOException e) { |
| 222 | + L.e(e); |
| 223 | + } |
| 224 | + } |
| 225 | + L.d("processInfo", processInfo.processName, processInfo.pid); |
| 226 | + } |
| 227 | + } |
| 228 | + super.onDismiss(dialogInterface); |
| 229 | + } |
223 | 230 | } |
0 commit comments