title: Activity has leaked window that was originally added here & other issues, concerns
body: <p>I have a few issues I'd like to share with you guys. </p>
  
  <p><a href="https://github.com/DaS4ilor/QuickPronote/" rel="nofollow"> All my files are on GITHUB</a></p>
  
  <p>First one concerns the error that's in the title. <code>FirstRun.java:82</code> refers to <code>alert.show();</code> and <code>FirstRun.java:63</code> to <code>alertDialog.show();</code></p>
  
  <p>The behaviour I'm observing goes as: </p>
  
  <ol>
  <li>The first alertDialog appears for a few seconds </li>
  <li>The application closes (not a force close)</li>
  <li>When I start to reboot the app, a blank screen is displayed (see following issues), meaning that my second activity is running. I'm using SharedPrefs to see whether or not one activity should be launched.  </li>
  </ol>
  
  <p>Complete logcat:</p>
  
  <pre><code>    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.&lt;init&gt;(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.&lt;init&gt;(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)
  </code></pre>
  
  <hr>
  
  <p>Another thing:</p>
  
  <p>SharedPrefs are doing strange things to me. After launching the app the first time, settings seem to have been saved and a (non-empty) file exists in <code>/data/data/carpedujourproductions.quickpronote/shared_prefs/</code>
  though it can't be read by any of my root file explorers (ES; Solid)</p>
  
  <hr>
  
  <p>Lastly: </p>
  
  <p>I'm having a bit of a trouble to handle conditions. If you look at my <code>MainActivity.java</code>, Android Studio tells me the strings <code>urlt</code> &amp; <code>url</code> are never used. How could I write them so that they would follow the order that is displayed on the file? (read <code>etab_sel</code> --> determine and write value to <code>urlt</code> --> read <code>user_is</code> --> determine and write value to <code>url</code> --> execute JS code with <code>url</code> as one of the variable.</p>
  
  <p>BIG BIG thanks to anyone who can provide answsers on any of these. The three may be related somehow though.  </p>