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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:49:39+00:00 2026-06-11T08:49:39+00:00

I have a problem with my android application. I need to show all files

  • 0

I have a problem with my android application.

I need to show all files from a folder which user ‘chooses’ from the listview.
It works well if i do that in one activity, but i need to make it show files from the chosen folder in other activity listview.

For example:

We go list of folders in listview in activity A

  • Folders:
  • test
  • testfolder
  • …and more folders

For example folder “testfolder” contains text files so when i click on “testfolder” i need to show text files in listview of activity B

public class FolderActivity extends Activity {

EditText folderName;
ListView listView;
String CURRENT_FOLDER = Environment.getExternalStorageDirectory().toString()+"/AppicationTest";

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_folder);


    Button button = (Button)findViewById(R.id.go);  


    createFolderOnStart();

    refreshDirectory();


    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        public void onItemClick(AdapterView<?> lista, View arg1, int position, long arg3) {
            Intent intent = new Intent(getApplicationContext(), ShowFiles.class);

            File file = new File(CURRENT_FOLDER + "/" + lista.getItemAtPosition(position));                                     

            if(file.canRead()){
                if(file.isDirectory()){
                    String[] list = file.list();

                    CURRENT_FOLDER += "/" + lista.getItemAtPosition(position);

                    listView.setAdapter(new ArrayAdapter<String>(getBaseContext(), android.R.layout.simple_list_item_1, list)); 

                    intent.putExtra("files", list);

                }
            }
            startActivity(intent);
        }
    });
}

Here is the code of first activity.

What should i do to make files display in listview of second activity?

  • 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-11T08:49:40+00:00Added an answer on June 11, 2026 at 8:49 am

    pass the full path of the current selected folder to activity B by passing through intent.
    Parse the same in B activity and show the files

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

Sidebar

Related Questions

I have a problem with my android application. That application which uses the kSOAP
I have an interesting problem being reported to me from an android application I
I need an Android application which should be able to fetch data from the
I have problem with my Android application. I need an application that will send
Yet another compatibility problem from me. BACKGROUND I have an application that works in
I have a problem with facebook user login in my android application. I want
I have a gallery viewer for an Android application. I need to show, first,
I have a problem in my android application, I have a hand page, I
i have a problem with my Android Application. The Error occures when i want
I'm developing an Android application with a spinner. I have this problem: This is

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.