JesusJoseph Posted July 16, 2018 Share Posted July 16, 2018 Hi All, Thanks for reading. I am creating a Game using Phaser and Cordova. I use window.innerWidth to set the width of the game. It works correctly for the first time by returning the screen width. But after I closing the game by press the back button in my android mobile it's not working. When I open the game again the window.innerWidth is returning as 0 and not the screen width. I try to get the width using the below Cordova plugin but it's not working. https://github.com/pbakondy/cordova-plugin-screensize Any help will really helpful. Tried for the whole day but nothing works. Link to comment Share on other sites More sharing options...
rich Posted July 16, 2018 Share Posted July 16, 2018 Try adding a delay before getting the width. My guess is that Android is just too slow and doesn't calculate it quickly enough for when you call it. Link to comment Share on other sites More sharing options...
Recommended Posts