public class move implements Serializable
{
private static final long serialVersionUID = 6696031872468154516L;
public move(int a,int b){
x=a;
y=b;
}
int x,y;
}
我通过 ObjectOutputStream 发送这个 - 只使用 out.writeObject(params[0]);
当我看到 LogCat 时,它说:
06-02 16:09:48.750: W/System.err(6060): java.io.NotSerializableException: com.SWAP.AndTablet.MainActivity
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1364)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
06-02 16:09:48.750: W/System.err(6060): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
06-02 16:09:48.754: W/System.err(6060): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
06-02 16:09:48.754: W/System.err(6060): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
06-02 16:09:48.754: W/System.err(6060): at com.SWAP.AndTablet.MainActivity$MouseMoveSendTask.doInBackground(MainActivity.java:59)
06-02 16:09:48.754: W/System.err(6060): at com.SWAP.AndTablet.MainActivity$MouseMoveSendTask.doInBackground(MainActivity.java:1)
06-02 16:09:48.754: W/System.err(6060): at android.os.AsyncTask$2.call(AsyncTask.java:264)
06-02 16:09:48.754: W/System.err(6060): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-02 16:09:48.754: W/System.err(6060): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-02 16:09:48.754: W/System.err(6060): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
06-02 16:09:48.757: W/System.err(6060): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
06-02 16:09:48.757: W/System.err(6060): at java.lang.Thread.run(Thread.java:856)
谁能帮我?