how to get Activity's windowToken without view?
I faced exactly the same problem, while writing OnPageChangeListener
within an Activity. You can use one of these solutions. Either:
getWindow().getDecorView().getRootView().getWindowToken()
or:
findViewById(android.R.id.content).getWindowToken()
Surely you can use:
getContentView().getWindowToken()
or you can refer to SO Quest
Simply use getWindow().getDecorView().getWindowToken()