You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
Create a standard lein-droid application, including splash screen as a MAIN category activity and a central DEFAULT activity
Start app and central activity; The activity needs to i.e. call neko.data/get-shared-preferences which uses the global ref to neko.context/context
Leave app by switching launcher
Start a couple of memory-hungry processes to force activity destruction
Launch the activity, make sure that in your test case the splash screen isn't shown again, if neccesary repeat.
Activity will crash as soon as neko.data/get-shared-preferences is called with a RuntimeException:
clojure.lang.Var$Unbound cannot be cast to android.content.Context
It seems that the SplashActivity's static firstLaunch field is still in its previous state, causing the splash activity to directly proceed(), without calling neko.init/init again.
I'm filing this against neko rather than lein-droid, because I'd like to propose that the use of neko.context/context should be completely removed from the library. It appears to me that the current solution is neither idiomatic for Clojure nor for Android ...
Update 2014-03-14: You may have to implement a sticky service that's restarted once the starting activity is destroyed to reproduce.
The text was updated successfully, but these errors were encountered:
Update 2014-03-19:
For reference of a somewhat rushed removal of all static global contexts, see my fork at https://github.com/vschlecht/neko; Currently this breaks the data.readers and implies a more awkward interface to notify, the rest is rather straightforward.
You are right about this being not idiomatic. Although if I could stand an additional arguments to toasts, data readers is really a miss. Do you think they can be somehow preserved with removing the static context instance?
Yes, I think the data-readers could be salvaged:
Since context is needed only to construct the resource path, which in turn depends on the package name, that's something that could be taken care of by lein-droid at compile time.
Would it be thinkable to rip the data-readers out of neko, and make them part of lein-droid?
How to reproduce:
clojure.lang.Var$Unbound cannot be cast to android.content.Context
It seems that the SplashActivity's static firstLaunch field is still in its previous state, causing the splash activity to directly proceed(), without calling neko.init/init again.
I'm filing this against neko rather than lein-droid, because I'd like to propose that the use of neko.context/context should be completely removed from the library. It appears to me that the current solution is neither idiomatic for Clojure nor for Android ...
Update 2014-03-14: You may have to implement a sticky service that's restarted once the starting activity is destroyed to reproduce.
The text was updated successfully, but these errors were encountered: