Skip to content

Commit 054134c

Browse files
committed
fix: 修复 UriUtils 转换问题
1 parent 0dccc80 commit 054134c

File tree

5 files changed

+36
-13
lines changed

5 files changed

+36
-13
lines changed

ue/src/main/AndroidManifest.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
43
package="com.linsh.utilseverywhere">
54

6-
<application
7-
android:allowBackup="true">
5+
<application android:allowBackup="true">
86
<provider
97
android:name=".FileProviderUtils$LshFileProvider"
10-
android:authorities="${applicationId}.lshfileprovider"
8+
android:authorities="${applicationId}.file.provider"
119
android:exported="false"
1210
android:grantUriPermissions="true">
1311
<meta-data
1412
android:name="android.support.FILE_PROVIDER_PATHS"
15-
android:resource="@xml/lsh_file_paths"/>
13+
android:resource="@xml/ue_provider_paths" />
1614
</provider>
1715
</application>
1816
</manifest>

ue/src/main/java/com/linsh/utilseverywhere/IntentUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ public static void gotoAccessibilitySetting() {
759759
*/
760760
private static void startActivity(Intent intent) {
761761
if (intent != null) {
762+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
762763
getContext().startActivity(intent);
763764
}
764765
}

ue/src/main/java/com/linsh/utilseverywhere/UriUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private UriUtils() {
4444
*/
4545
public static Uri file2Uri(@NonNull final File file) {
4646
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
47-
String authority = ContextUtils.getPackageName() + ".utilcode.provider";
47+
String authority = ContextUtils.getPackageName() + ".file.provider";
4848
return FileProvider.getUriForFile(ContextUtils.get(), authority, file);
4949
} else {
5050
return Uri.fromFile(file);

ue/src/main/res/xml/lsh_file_paths.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<paths>
3+
<root-path
4+
name="root_path"
5+
path="" />
6+
7+
<files-path
8+
name="files_path"
9+
path="." />
10+
11+
<cache-path
12+
name="cache_path"
13+
path="." />
14+
15+
<external-path
16+
name="external_path"
17+
path="." />
18+
19+
<external-files-path
20+
name="external_files_path"
21+
path="." />
22+
23+
<external-cache-path
24+
name="external_cache_path"
25+
path="." />
26+
27+
<external-media-path
28+
name="external_media_path"
29+
path="." />
30+
</paths>

0 commit comments

Comments
 (0)