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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:54:02+00:00 2026-05-20T07:54:02+00:00

I am using this code: File myDir = new File(getApplicationContext().getFilesDir().getAbsolutePath()); try { Log.i(CSV Testing

  • 0

I am using this code:

File myDir = new File(getApplicationContext().getFilesDir().getAbsolutePath());
try {                
    Log.i("CSV Testing ", "CSV file creating");
    FileWriter fw = new FileWriter(myDir + "/myfile.csv");
    //
                 // write data to file
                 //   
    Log.i("CSV Testing ", "CSV file created and your data has been saved");
    // Process for sending email with CSV file
    File CSVFile = new File(myDir,"myfile.csv");
    // And sending it with email attachment
} catch (IOException e) {
    Log.i("ExportCSV Exception", e.toString());
}

But it sends myfile.csv as a blank file. I checked it from file explorer, where myfile.csv is not blank and contains right data. How can I solve this?

My Logcat messages are

I/CSV Testing (16920): CSV file creating
I/CSV Testing (16920): CSV file created and your data has been saved
I/CSV FILE(16920): CSV file exists
I/SEND EMAIL TESTING(16920): Email sending
D/dalvikvm(16920): GC freed 2902 objects / 186576 bytes in 156ms
I/ActivityManager(   60): Starting activity: Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras) }
W/ActivityManager(   60): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=android.intent.action.CHOOSER flg=0x800000 cmp=android/com.android.internal.app.ChooserActivity (has extras) }
I/ActivityManager(   60): Displayed activity com.android.email/.activity.MessageCompose: 1156 ms (total 2117 ms)
W/InputManagerService(   60): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43cf3050 (uid=10023 pid=207)
W/IInputConnectionWrapper(  207): showStatusIcon on inactive InputConnection
  • 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-20T07:54:03+00:00Added an answer on May 20, 2026 at 7:54 am

    If really is this the case, your path to file must be missing somewhere, means your path to the file must be incorrect.

    And because of this, the statement File CSVFile = new File(myDir,"myfile.csv");must be creating new empty file on that location.

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

Sidebar

Related Questions

I am using this php code: exec(unrar e file.rar,$ret,$code); and getting an error code
I am using ASP.NET to transmit a .jar file. This code works perfectly on
I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. }
I am using this code to write to a file in java. it has
I have been using this code to read in a file from a document
I am using this code to download multiple file. My problem is that it
I am using this code to extract a password protected RAR file. I am
I am using this code to load the content of a text file: function
hii i am using ajax file upload in this code <script type=text/javascript src=fileuploader.js></script> <script
I'm using this code, to make a request to a given URL: private static

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.