1

Android API 10 で LinkedList を使用してオブジェクトを保存すると、エラーが発生します。

08-10 14:37:45.091: E/AndroidRuntime(29845): FATAL EXCEPTION:
Thread-17 08-10 14:37:45.091: E/AndroidRuntime(29845):
java.lang.IllegalArgumentException: no char field 'exponential' 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.io.EmulatedFields.put(EmulatedFields.java:459) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.io.EmulatedFieldsForDumping.put(EmulatedFieldsForDumping.java:83)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.text.DecimalFormatSymbols.writeObject(DecimalFormatSymbols.java:591)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.lang.reflect.Method.invokeNative(Native Method) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invoke(Method.java:507) 08-10 14:37:45.091:
E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1219)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1062)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeFields(ObjectOutputStream.java:1008)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.text.DecimalFormat.writeObject(DecimalFormat.java:1215) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invokeNative(Native Method) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invoke(Method.java:507) 08-10 14:37:45.091:
E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1219)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1143)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:413)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1241)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1205)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1143)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:413)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1241)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.util.LinkedList.writeObject(LinkedList.java:973) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invokeNative(Native Method) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invoke(Method.java:507) 08-10 14:37:45.091:
E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1219)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1143)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:413)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1241)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.util.LinkedList.writeObject(LinkedList.java:973) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invokeNative(Native Method) 08-10
14:37:45.091: E/AndroidRuntime(29845):    at
java.lang.reflect.Method.invoke(Method.java:507) 08-10 14:37:45.091:
E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1219)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575)
08-10 14:37:45.091: E/AndroidRuntime(29845):  at java.io.Ob

私はグリッチがどこにあるのかわからず、API 1以降のようにリンクリストが問題だとは思いませんが、Android API 18では発生しませんが、どこに問題があるのか​​ わかりませんか?

保存:

FileOutputStream fos = null;
    try {
        fos = openFileOutput("shelf.obj", Context.MODE_PRIVATE);
        ObjectOutputStream out = new ObjectOutputStream(fos);
        out.writeObject(listOfShelfs);
        out.close();
        fos.close();
    } catch (FileNotFoundException e) {
        //catch
    } catch (IOException e) {
        //catch
    }

保存するオブジェクト:

private static HashMap<String, MessageShelf> listOfShelfs = new HashMap<String, MessageShelf>();

メッセージシェルフ:

public class MessageShelf implements Serializable{
private static final long serialVersionUID = 1L;
public Friend correspodent;
Calendar lastSeen;
Calendar lastSend;
boolean secure;
Queue<MessageList> historyMessagesLists=new LinkedList<MessageList>();
public String lastMessageBody = "";
public Calendar lastDate;}
4

1 に答える 1