Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Back button exits application in android using appcelerator titanium

I am new to Titanium Development. In Native android if we press back button only current activity will be closed and it will go back to the previous activity but when I press the back button in Android using Titanium it exits from the application.

How can I change this behaviour?

like image 618
Himesh Shah Avatar asked Dec 17 '11 11:12

Himesh Shah


1 Answers

There are two types of windows like, lightweight and heavyweight. If you create a lightweight window in Titanium android than on back button press it will exist from your application.

You can achieve what you want by creating heavyweight window. You can create heavyweight window in titanium by open it as modal window. So put the parameter modal:true when you create a new window. New window will be created as modal window (heavyweight window for titanium android). And then after if you will press back button it will not exit from application.

like image 150
The Zero Avatar answered Oct 21 '22 17:10

The Zero