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 6837607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:29:51+00:00 2026-05-26T23:29:51+00:00

I my application i am going to implement the Progress dialog till its getting

  • 0

I my application i am going to implement the Progress dialog till its getting loading. . .
The code is like:

copyFileFromAssetsToSDCard("Alone.mp4");
intent = new Intent(this,VideoPlayerController.class);
startActivity(intent);

So how to implement it ??
Thanks.

Code for the function is:

public void copyFileFromAssetsToSDCard(String fileFromAssets){
    AssetManager is = this.getAssets();
    InputStream fis;
    try {

        fis = is.open(fileFromAssets);
        FileOutputStream fos;

        fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory(), fileFromAssets));
        byte[] b = new byte[8];
        int i;
        while ((i = fis.read(b)) != -1) {
            fos.write(b, 0, i);
        }
        fos.flush();
        fos.close();
        fis.close();
    } catch (IOException e1) {
        e1.printStackTrace();
    }
}
  • 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-05-26T23:29:51+00:00Added an answer on May 26, 2026 at 11:29 pm

    You can do like this,

    Create an ArrayList<String> files = new ArrayList<String>(); and add all the files that you can to copy to SDCard like the below.

            files.add("test.png");
            files.add("icon.png");
            new myAsyncTask().execute(files);
    

    Then you can just use this ArrayList object to pass to AsynTask and get it done.

    private class myAsyncTask extends AsyncTask<ArrayList<String>, Void, Void>
        {
            ArrayList<String> files;
            ProgressDialog dialog;
            @Override
            protected void onPreExecute() {
                dialog = ProgressDialog.show(mainact.this, "Loading...", "");
            }
            @Override
            protected Void doInBackground(ArrayList<String>... params) {
    
                files = params[0];
                for (int i = 0; i < files.size(); i++) {
                    copyFileFromAssetsToSDCard(files.get(i));   
                }
                return null;
            }
            @Override
            protected void onPostExecute(Void result) {
                dialog.dismiss();
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that is going to work like a p2p-software where all
So I'm building an application that is going to do a ton of code
I'm going to implement a (simple) downloader application in Java as a personal exercise.
I am going to implement StoreKit in an iPhone application and wanted to know
I am going to create an application in that i have to implement an
In My Application i have Implement the Simple Gallery Demo. Here i am going
We are going to implement a small java application with BDD, which reads an
I'm building an application whose usage is going to look something like this: application
I am going to implement an application that is gathering data from Android device.
I am going to implement an in-application maps in my Android application, so my

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.