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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:29:10+00:00 2026-06-11T12:29:10+00:00

I want to save an image that I draw, but a failure is always

  • 0

I want to save an image that I draw, but a failure is always reported:

09-12 07:30:34.346: E / Panel (8003): IOEception
09-12 07:30:34.346: E / Panel (8003): java.io.IOException: Parent directory of file does not exist: / sdcard/anppp/2012Sep1273034.png
09-12 07:30:34.346: E / Panel (8003): at java.io.File.createNewFile (File.java: 1263)
09-12 07:30:34.346: E / Panel (8003): at aa.bb.cc.Panel.saveapp (Panel.java: 67)
09-12 07:30:34.346: E / Panel (8003): at aa.bb.cc.AndroidPaint.onOptionsItemSelected (AndroidPaint.java: 94)
09-12 07:30:34.346: E / Panel (8003): at android.app.Activity.onMenuItemSelected (Activity.java: 2170)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected (PhoneWindow.java: 730)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.view.menu.MenuItemImpl.invoke (MenuItemImpl.java: 139)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.view.menu.MenuBuilder.performItemAction (MenuBuilder.java: 855)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.view.menu.ExpandedMenuView.invokeItem (ExpandedMenuView.java: 89)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.view.menu.ExpandedMenuView.onItemClick (ExpandedMenuView.java: 93)
09-12 07:30:34.346: E / Panel (8003): at android.widget.AdapterView.performItemClick (AdapterView.java: 284)
09-12 07:30:34.346: E / Panel (8003): at android.widget.ListView.performItemClick (ListView.java: 3285)
09-12 07:30:34.346: E / Panel (8003): at android.widget.AbsListView $ PerformClick.run (AbsListView.java: 1640)
09-12 07:30:34.346: E / Panel (8003): at android.os.Handler.handleCallback (Handler.java: 587)
09-12 07:30:34.346: E / Panel (8003): at android.os.Handler.dispatchMessage (Handler.java: 92)
09-12 07:30:34.346: E / Panel (8003): at android.os.Looper.loop (Looper.java: 123)
09-12 07:30:34.346: E / Panel (8003): at android.app.ActivityThread.main (ActivityThread.java: 4363)
09-12 07:30:34.346: E / Panel (8003): at java.lang.reflect.Method.invokeNative (Native Method)
09-12 07:30:34.346: E / Panel (8003): at java.lang.reflect.Method.invoke (Method.java: 521)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 860)
09-12 07:30:34.346: E / Panel (8003): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 618)
09-12 07:30:34.346: E / Panel (8003): at dalvik.system.NativeStart.main (Native Method)

My code:

private Bitmap mBitmap;
private Canvas mCanvas;
private Bitmap tmpBitmap;
private Canvas tmpCanvas;
private DrawHandler mDrawHandler;
private Canvas tCanvas;
private String mImagePath = Environment.getExternalStorageDirectory() + "/anppp";
private File file;

public void saveapp() {

    Calendar currentDate = Calendar.getInstance();
    SimpleDateFormat formatter= new SimpleDateFormat("yyyyMMMddHmmss");
    String dateNow = formatter.format(currentDate.getTime());
    file = new File(mImagePath + "/" + dateNow +".png");
    FileOutputStream fos;
    try {
        file.createNewFile();
        fos = new FileOutputStream(file);
        tmpBitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
        fos.close();
        } catch (FileNotFoundException e) {
        Log.e("Panel", "FileNotFoundException", e);
    }
    catch (IOException e) {
        Log.e("Panel", "IOEception", e);
    }
}

That’s it .. I do not know what could be wrong ;(

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

    I think you are not having the folder with name anppp in your sdcard.
    So i suggest you to first create it using

    File dirPath = new File(Environment.getExternalStorageDirectory().toString() + "/anppp");
    dirPath.mkdirs();
    

    and now perform the tasks you are doing.
    Hope this helps you

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

Sidebar

Related Questions

I want to save the image that is pinched to different size from original
I want to use the 2D Java API to draw on a JLabel that
I want to save Image in Database with JSON web service .without image data
I have an image in an UIImageView and want to save it to the
I'm using 3d in WPF and want to save it to a 2d image
I want to extract first frame of uploaded video and save it as image
I want to capture a single image from my webcam and save it to
I am working on blackberry project where i want to download image & save
I want to save the loaded image from server in idle time.I use the
Have a photography site that I want to prevent image copying from. How can

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.