I've made an Android app that use a custom listview with an adapter, a refresh button and an onlick event for each row.My problem is that the first time that the list load all works well, but when i hit refresh then i click on a random row the app crashes with the following error:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
In the onlick event i have a custom dialog with 4 buttons, the error is in the highlighted row.
This is the adapter part:
I tried by clearing adapter, list, change context, nothing works...Thanks a lot, tell me if you need more code.