我有几个问题想和大家分享。
第一个涉及标题中的错误。FirstRun.java:82
指alert.show();
和FirstRun.java:63
_alertDialog.show();
我观察到的行为如下:
- 第一个 alertDialog 出现几秒钟
- 应用程序关闭(不是强制关闭)
- 当我开始重新启动应用程序时,会显示一个空白屏幕(请参阅以下问题),这意味着我的第二个活动正在运行。我正在使用 SharedPrefs 来查看是否应该启动一项活动。
完整的logcat:
32444-32444/carpedujourproductions.quickpronote E/WindowManager: Activity carpedujourproductions.quickpronote.FirstRun has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{967f7300 V.E..... R.....ID 0,0-729,594} that was originally added here
android.view.WindowLeaked: Activity carpedujourproductions.quickpronote.FirstRun has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{967f7300 V.E..... R.....ID 0,0-729,594} that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:345)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:239)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:281)
at carpedujourproductions.quickpronote.FirstRun.onCreate(FirstRun.java:63)
at android.app.Activity.performCreate(Activity.java:5207)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2281)
at android.app.ActivityThread.access$600(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:110)
at dalvik.system.NativeStart.main(Native Method)
32444-32444/carpedujourproductions.quickpronote E/WindowManager: Activity carpedujourproductions.quickpronote.FirstRun has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{968738b8 V.E..... R......D 0,0-729,585} that was originally added here
android.view.WindowLeaked: Activity carpedujourproductions.quickpronote.FirstRun has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{968738b8 V.E..... R......D 0,0-729,585} that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:345)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:239)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:281)
at android.app.AlertDialog$Builder.show(AlertDialog.java:951)
at carpedujourproductions.quickpronote.FirstRun.onCreate(FirstRun.java:82)
at android.app.Activity.performCreate(Activity.java:5207)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2281)
at android.app.ActivityThread.access$600(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:110)
at dalvik.system.NativeStart.main(Native Method)
另一件事:
SharedPrefs 对我做了奇怪的事情。第一次启动应用程序后,设置似乎已保存,并且存在一个(非空)文件,/data/data/carpedujourproductions.quickpronote/shared_prefs/
尽管我的任何根文件浏览器都无法读取它(ES;Solid)
最后:
我在处理条件时遇到了一些麻烦。如果您查看我的MainActivity.java
,Android Studio 会告诉我字符串urlt
&url
从未使用过。我如何编写它们以便它们遵循文件上显示的顺序?(读取etab_sel
--> 确定并将值写入urlt
--> 读取user_is
--> 确定并将值写入url
--> 将 JS 代码url
作为变量之一执行。
非常感谢任何可以就这些问题提供答案的人。这三者可能以某种方式相关。