|
1 | 1 | /*
|
2 |
| - * Copyright 2018-2022 Pranav Pandey |
| 2 | + * Copyright 2018-2024 Pranav Pandey |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -398,24 +398,25 @@ public static boolean editTheme(@Nullable Context context,
|
398 | 398 | }
|
399 | 399 |
|
400 | 400 | try {
|
| 401 | + Intent intent = getThemeIntent(context, clazz, action, theme, defaultTheme, text); |
| 402 | + if (Theme.Intent.ACTION_CAPTURE.equals(action)) { |
| 403 | + intent.setPackage(null); |
| 404 | + } |
| 405 | + |
401 | 406 | if (owner instanceof DynamicSystemActivity) {
|
402 |
| - ((DynamicActivity) owner).startMotionActivityForResult(getThemeIntent(context, |
403 |
| - clazz, action, theme, defaultTheme, text), requestCode, bundle); |
| 407 | + ((DynamicActivity) owner).startMotionActivityForResult( |
| 408 | + intent, requestCode, bundle); |
404 | 409 | } else if (owner instanceof DynamicFragment) {
|
405 |
| - ((DynamicFragment) owner).startMotionActivityForResult(getThemeIntent(context, |
406 |
| - clazz, action, theme, defaultTheme, text), requestCode, bundle); |
| 410 | + ((DynamicFragment) owner).startMotionActivityForResult( |
| 411 | + intent, requestCode, bundle); |
407 | 412 | } else if (owner instanceof Activity) {
|
408 |
| - ((Activity) owner).startActivityForResult(getThemeIntent(context, |
409 |
| - clazz, action, theme, defaultTheme, text), requestCode, bundle); |
| 413 | + ((Activity) owner).startActivityForResult(intent, requestCode, bundle); |
410 | 414 | } else if (owner instanceof Fragment) {
|
411 |
| - ((Fragment) owner).startActivityForResult(getThemeIntent(context, |
412 |
| - clazz, action, theme, defaultTheme, text), requestCode, bundle); |
| 415 | + ((Fragment) owner).startActivityForResult(intent, requestCode, bundle); |
413 | 416 | } else if (context instanceof Activity) {
|
414 |
| - ((Activity) context).startActivityForResult(getThemeIntent(context, |
415 |
| - clazz, action, theme, defaultTheme, text), requestCode, bundle); |
| 417 | + ((Activity) context).startActivityForResult(intent, requestCode, bundle); |
416 | 418 | } else {
|
417 |
| - context.startActivity(getThemeIntent(context, |
418 |
| - clazz, action, theme, defaultTheme, text)); |
| 419 | + context.startActivity(intent); |
419 | 420 | }
|
420 | 421 | } catch (Exception e) {
|
421 | 422 | e.printStackTrace();
|
|
0 commit comments