Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

Kotlin app crash when list refreshed on click

$
0
0

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.

row onclick event

This is the adapter part:

adapter

I tried by clearing adapter, list, change context, nothing works...Thanks a lot, tell me if you need more code.


Viewing all articles
Browse latest Browse all 7199

Trending Articles