It sounds as though your apps work fine on a real device. Here are some things to try but one thing of note is that running apps on an emulator are not really a good representation of "real world" performance.
Usually I just get 'app has stopped responding' errors when running on an emulator and the reason for that is because they are very very slow (and yes, they can slow down your entire system because they are using a lot of your computer's processor and memory in order to run the AVD).
Because you are getting a Null Pointer Exception, it could still be related to being run on an AVD. One possible reason is that it is killing off other processes or old activities in order to free up resources. If this is the case, you may need to add some code to check that processes are still around before trying to use them. I don't know what your code is like in reference to your error but to give you an example I would sometimes have crashes in my app if the tried changing a label in another activity but the activity was no longer in memory at all. This of course resulted in a NPE error. This would happen on AVDs but only occasionally on my real device. I found a way to force it to happen by browsing the internet while my app was "paused" then returning to it. Because Android had killed part of my app in order to make room for the browser app, the result was a NPE when I would try to do certain things in my app after returning to it.
So you may need to check to see if the activity or variables that you are trying to use with the PreferenceActivity are still around before trying to use it. One way to do that in regards to activities is to use the new
CallSubDelayed command although I don't know if that is applicable to PreferenceActivity because I don't use that in my apps.
Other things to try:
- Make sure you have set your AVD up with a decent amount of "RAM"
- Try running your app on a less demanding AVD, such as one with a smaller screen resolution and size configuration and lower SDK (i.e. Android 2.3 rather than 4.0)
Good luck!
NPE errors were my biggest nemesis while learning to work with B4A and Android. Eventually things settled in and I learned how to avoid them and code my apps better. Again though, this could just be an AVD issue. Running my app on an AVD on my main PC may work fine, where as running my app on that same AVD on my notebook may be very slow if it ever starts at all.