Forums

OverviewV-Play 1 SupportTrouble implementing Android back button › Reply To: Trouble implementing Android back button

OverviewV-Play 1 SupportTrouble implementing Android back button › Reply To: Trouble implementing Android back button
#6867

Andrew

RESOLVED. I was tinkering around and found out what I needed to do. In my main.qml I added

onStateChanged: {
  if (state === "main")
    activeScene = startScene //startScene is the id of the scene you wish to implement back functionality.
}

 

In my StartScene.qml I added

Connections{
  target: activeScene
  onBackPressed: {
    Qt.quit()
  }
}

As I am a beginner in app development and v-play, I just modified the template code using the Connections item, although I am not sure if this is an effective way to do it (it does work, however). I hope this helps somebody out! I had to reply because I hate when searching forum posts that have my same problem and just end with “lol nevermind” and leave me hanging.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support