This is a very weird problem. My app that runs just fine but somehow if I leave my phone for an hour or two while my app is running, I get the following error when I come ba
Are you playing games with custom classloaders?
I ask, because if yoga.YogaActivity
and yoga.database.Manager
are standard Java classes in the same Android APK file, you should not have one in memory and the other not. I have never seen Android unload classes on a one-off basis -- leastways, I have never run into this particular problem before.
Also:
I leave my phone for an hour or two while my app is running
You might want to clarify what you mean by this. Do you mean that you leave your activity in the foreground? Do you mean that you press HOME and then come back to it hours later? Do you mean something else?
The Dalvik VM doesn't currently unload classes. If it did, it would only be able to do so when all classes associated with a particular class loader could be unloaded at once, which will not be the case while your app is running.
You need to check the logcat output for errors leading up to this exception. One way to get a NoClassDefFoundError is for something to fail during initialization of the class in question; if that happened there would likely be a trail in the log.
(Of course, by now the logcat output is probably long gone, but if the problem is repeatable you'll want to capture it next time.)