Jump to content

window.innerWidth returns zero in Android App after pressing back button


JesusJoseph
 Share

Recommended Posts

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...