Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:26:26+00:00 2026-06-15T10:26:26+00:00

I am using titanium to make a small app where i can click on

  • 0

I am using titanium to make a small app where i can click on a ‘gallery’ button located in a window and it opens photogallery. On selecting the photo it should move to next window. But what it does is, it closes the photogallery first, after that i can see my first(button) screen and then it opens the next window.

I dont want it to show the previous window. Is there a way to do it??

I am adding windows to tabs . Below is my code .

cameraButton.addEventListener('click',function(e){
            chooseImageFromGallery();
        }); 



function chooseImageFromGallery(){

        var capturedImg;

        //TODO     Titanium.Media.showCamera({
        Titanium.Media.openPhotoGallery({
            success : function(event) {

                capturedImg = event.media;

                /* Condition to check the selected media */
                if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
                        var window1 = MyWindows.init(capturedImg, docImgModel, previous_win);

                                MyCommon.addWindowToTabGroup(window1);
                        win.close();
                }
            },
            cancel : function() {
                //While cancellation of the process
                activityInd.hide();
                        win.remove(activityInd);
            },
            error : function(error) {
                /* called when there's an error */
                var a = Titanium.UI.createAlertDialog({
                    titleid : 'camera'
                });
                if (error.code == Titanium.Media.NO_CAMERA) {
                    a.setMessage(L('camera_not_available'));
                } else {
                    a.setMessage('Unexpected error: ' + error.message);
                }
                a.show();
                activityInd.hide();
                win.remove(activityInd);

            }
        });

    }

The init method just creates a new window and returns it .

The addWindowToTabGroup method adds it to the current tab

addWindowToTabGroup(window){
    // tabGroup is a tab at global level declared in app.js
    // activeTab returns the current tab
    tabGroup.activeTab.open(window, {
                animated : true
            });
}

Thanks a lot ….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:26:27+00:00Added an answer on June 15, 2026 at 10:26 am

    You can do it this way:
    1- on button click fire a global event which will open your photo gallery and then close your current window.

    2- Now in success call back of photo gallery (when photo is selected) write you code of opening the new window you want to show your user …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Titanium to develop an Android/Ipad app. I can't find the exact dp
I am using Titanium Appcelerator, I want to refresh Window/TableView/ScrollView manually. How can I
I am working on a small iPhone app using Titanium/Appcelerator. Now what I am
Am looking into developing an iPhone native app using Titanium Developer Since this is
I am writing my app in JavaScript using Appcelerator's Titanium IDE. I've been working
I'm creating android app using Titanium mobile. How do I create this interface using
I have a simple mobile app in Titanium that I'm using to debug the
I am using titanium sdk for mobile app development. I was just searching for
I've just started with titanium and I can't make the Ti.API.info(My log message) to
I am using Titanium Studio. I build an application, I can debug the application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.