I m trying to serialize the webView object but could not able to do
so , i successfully saved it , but cannot able DeSerialized it , any
suggestions ? Thanks In Advance ...

here is the code ,

< ************************************ BEGIN CODE
*************************************** >

public class MyWebView extends WebView implements Serializable {

        static final long serialVersionUID = 7523967970034938905L;

        public MyWebView (Context c){
                super(c);
        }

}

    public boolean saveObject(String fileName,MyWebView
data_TO_BE_SAVED){

        boolean result = false;
        File myFile=null;

                myFile = getFileStreamPath("X").getParentFile();
                myFile = new File(myFile,fileName);

                try{

        FileOutputStream fos = openFileOutput(path,
Context.MODE_WORLD_READABLE); // also i checked MODE_APPEND

                ObjectOutputStream oos = new ObjectOutputStream(fos);
                oos.writeObject(data_TO_BE_SAVED);

                oos.flush();
                oos.close();

                fos.flush();
                fos.close();

                System.out.println("Object Saved.....");


                result = true;
                }catch(Exception ex){
                        ex.printStackTrace();

                }


 return result;
    }

    public void getSavedObject(String fileName){
        try{

                FileInputStream fis =   this.openFileInput(path);
                ObjectInputStream ois = new ObjectInputStream(fis);

                Object obj = ois.readObject();       // Here Comes the error

                ois.close();
                fis.close();
        }catch(Exception ex){
                ex.printStackTrace();

        }



    }
< ***************************************   END CODE
*************************************** >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to