Skip to content

Commit d441a8b

Browse files
author
维术
committed
[Exposed-core]: fix NPE caused by can reorder.
1 parent e8b5df8 commit d441a8b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

VirtualApp/app/src/main/java/io/virtualapp/VApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
public class VApp extends MultiDexApplication {
3232

33-
private static final String XPOSED_INSTALLER_PACKAGE = "de.robv.android.xposed.installer";
33+
public static final String XPOSED_INSTALLER_PACKAGE = "de.robv.android.xposed.installer";
3434

3535
private static VApp gApp;
3636
private SharedPreferences mPreferences;

VirtualApp/app/src/main/java/io/virtualapp/home/HomeActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ public boolean canDropOver(RecyclerView recyclerView, RecyclerView.ViewHolder cu
432432
}
433433
try {
434434
AppData data = mLaunchpadAdapter.getList().get(target.getAdapterPosition());
435-
return data.canReorder();
435+
if (data != null) {
436+
return data.canReorder();
437+
}
436438
} catch (IndexOutOfBoundsException e) {
437439
e.printStackTrace();
438440
}

VirtualApp/app/src/main/java/io/virtualapp/home/models/PackageAppData.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import com.lody.virtual.remote.InstalledAppInfo;
99

10+
import io.virtualapp.VApp;
11+
1012
/**
1113
* @author Lody
1214
*/
@@ -74,6 +76,9 @@ public String getName() {
7476

7577
@Override
7678
public boolean canReorder() {
79+
if (VApp.XPOSED_INSTALLER_PACKAGE.equals(packageName)) {
80+
return false;
81+
}
7782
return true;
7883
}
7984

0 commit comments

Comments
 (0)