Fix crash
This commit is contained in:
parent
f8e7d91511
commit
58fd114419
|
|
@ -48,8 +48,7 @@ public class Init {
|
|||
get().handler.post(() -> Toast.makeText(context(), msg, Toast.LENGTH_LONG).show());
|
||||
}
|
||||
|
||||
public static Activity getActivity() {
|
||||
try {
|
||||
public static Activity getActivity() throws Exception {
|
||||
Class<?> activityThreadClass = Class.forName("android.app.ActivityThread");
|
||||
Object activityThread = activityThreadClass.getMethod("currentActivityThread").invoke(null);
|
||||
Field activitiesField = activityThreadClass.getDeclaredField("mActivities");
|
||||
|
|
@ -67,9 +66,6 @@ public class Init {
|
|||
return activity;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,13 +163,19 @@ public class Misc {
|
|||
}
|
||||
|
||||
public static void addView(View view, ViewGroup.LayoutParams params) {
|
||||
try {
|
||||
ViewGroup group = Init.getActivity().getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
group.addView(view, params);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeView(View view) {
|
||||
try {
|
||||
ViewGroup group = Init.getActivity().getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
group.removeView(view);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadWebView(String url, WebViewClient client) {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
906b337d4b4baef13292d004e5fd8f9b
|
||||
487834a2d0d9aa7614beeba237cce0c2
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;906b337d4b4baef13292d004e5fd8f9b",
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;487834a2d0d9aa7614beeba237cce0c2",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"lives": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;906b337d4b4baef13292d004e5fd8f9b",
|
||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;487834a2d0d9aa7614beeba237cce0c2",
|
||||
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
|
||||
"lives": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue