Saving an bitmap using OutputStream on Android, on following Activities onPause.

In my Activity's onCreate i have

  public void onCreate() {
    try
    {
        FIStream = super.openFileInput("4.png");
        MyImagePort.load(FIStream);
        FIStream.close();   
        FIStream = null;
    } catch (FileNotFoundException e) {
        Log.w("spriter","File not found");
    } catch (IOException e) {
        e.printStackTrace();
    }
    }

Which seems to work fine.

But then my Activity Overrides onPause..

@Override
    public void onPause(){
    super.onPause();
    DoAutoSave();
}

private void DoAutoSave() {
    try {
    FOStream = new FileOutputStream("\\sdcard\\spriter\\4.png");
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    }   
  MyImagePort.SetAutoSaveFileStream(FOStream);
 }  

The problem is, FOStream above never recieves a OutputStream and is always null. what am i doing wrong please

Answers


Need Your Help

SQL Error Version 5.5.15

mysql innodb myisam

Can anyone show or tell me whats wrong in this block? I can not see it.

Get current logged in Windows Users privilliges

windows vb.net windows-7 windows-process windows-vista-software

I have to get current user privileges before opening my main application screen.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.