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

  • SEARCH
  • Home
  • 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 8946793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:35:37+00:00 2026-06-15T12:35:37+00:00

I have a big problem. Firstly, I have a list of items.When user clicks

  • 0

I have a big problem.
Firstly, I have a list of items.When user clicks on each item, my app start download file from internet.
I have implemented this with AsyncTask serial excutor.
After download file completed, my app starts to run Android Installer immediately and when application installed successfully. I want to send device’s info to server

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive");
activity.startActivityForResult(intent, 1);

MainActivity.java

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 1) {
        List<PackageInfo> packs = this.getPackageManager()
                .getInstalledPackages(0);
        for (int i = 0; i < packs.size(); i++) {
            PackageInfo p = packs.get(i);
            if (InstalledPackageName != null
                    && InstalledPackageName.equals(p.packageName)) {
           //file install success 
                QstoreRestClient rest = new QstoreRestClient(this,
                        "Please wait...");
                SecurityInstallManager secure = new SecurityInstallManager();
                String strDeviceID = getUniqueDeviceId();
                String strProductID = InstalledPackageID;
                String strToken = mToken;
                String strModel = getModelDevice();
                Log.d("QSTORE mUserName", mUserName);
                Log.d("QSTORE strProductID", strProductID);
                Log.d("QSTORE strDeviceID", strDeviceID);
                Log.d("QSTORE strToken", strToken);
                Log.d("QSTORE strModel", strModel);
                String strSHA = secure.getSHAHighscore(mUserName,
                        strDeviceID, strProductID, strToken);
                rest.installShowLoading(mUserName, strProductID,
                        strDeviceID, strSHA, strModel, this);
                Log.d("QSTORE", "Already Installed");
                // return;
            }
        }
        // }

        InstalledPackageName = null;
        InstalledPackageID = null;
    }
    super.onActivityResult(requestCode, resultCode, data);
}

My question:
You can see when a file download completed, my app run Android Installer in a new Activity and send the result back to main activity(call OnActivityResult())
The problem here, if user download 5 files,my app run 5 new Activity for install new application so the result of each child activity can’t send back to main activity.
I’m wondering is there any way to resolve this problem?

  • 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-15T12:35:38+00:00Added an answer on June 15, 2026 at 12:35 pm

    As soon as you finish download of the file, add the file to a Queue. Then you check whether the number of items in the queue is greater than 1 or not. If its greater than 1, do not take any action. If its equal to 1, start the installation.
    Now, after installation is successful, you remove the entry from the queue. And then do the check again and see if there are any more items in the queue. And then follow the same logic.

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

Sidebar

Related Questions

I have a big problem: I have a listview and each item links to
I have a big problem with exporting my table to Excel file format. Firstly
I have big problem when I am trying to deploy my app over clickonce.
I'm using editor from Kendo UI, so I have big problem. I don't know
I have a big problem with my app as it crashes often but never
I have a big problem. I want to extract text from html table that
I have a big problem dealing with data I try to download in my
I use plugin Comments from CakeDC and have big problem in production mode (debug=0).
I work on iOS app with recording feature. I have big problem with straight
I have big problem with reading big numbers from excel in java. When i

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.