ClassNotFoundException
<pre><code>07-14 11:58:28.160: WARN/Intent(1911): Failure filling in extras
07-14 11:58:28.160: WARN/Intent(1911): java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = ams.gelato.api.TaskScheduler$Task)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Parcel.readSerializable(Parcel.java:1890)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Parcel.readValue(Parcel.java:1761)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Parcel.readMapInternal(Parcel.java:1947)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Bundle.unparcel(Bundle.java:169)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Bundle.putAll(Bundle.java:242)
07-14 11:58:28.160: WARN/Intent(1911):     at android.content.Intent.fillIn(Intent.java:4853)
07-14 11:58:28.160: WARN/Intent(1911):     at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:194)
07-14 11:58:28.160: WARN/Intent(1911):     at com.android.server.am.PendingIntentRecord.send(PendingIntentRecord.java:176)
07-14 11:58:28.160: WARN/Intent(1911):     at android.app.PendingIntent.send(PendingIntent.java:400)
07-14 11:58:28.160: WARN/Intent(1911):     at com.android.server.AlarmManagerService$AlarmThread.run(AlarmManagerService.java:645)
07-14 11:58:28.160: WARN/Intent(1911): Caused by: java.lang.ClassNotFoundException: ams.gelato.api.TaskScheduler$Task
07-14 11:58:28.160: WARN/Intent(1911):     at java.lang.Class.classForName(Native Method)
07-14 11:58:28.160: WARN/Intent(1911):     at java.lang.Class.forName(Class.java:237)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2604)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1860)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:840)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2080)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:943)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2299)
07-14 11:58:28.160: WARN/Intent(1911):     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2254)
07-14 11:58:28.160: WARN/Intent(1911):     at android.os.Parcel.readSerializable(Parcel.java:1884)
07-14 11:58:28.160: WARN/Intent(1911):     ... 9 more
07-14 11:58:28.160: WARN/Intent(1911): Caused by: java.lang.NoClassDefFoundError: ams.gelato.api.TaskScheduler$Task
07-14 11:58:28.160: WARN/Intent(1911):     ... 19 more
07-14 11:58:28.160: WARN/Intent(1911): Caused by: java.lang.ClassNotFoundException: ams.gelato.api.TaskScheduler$Task in loader dalvik.system.PathClassLoader@4001b4f8
07-14 11:58:28.160: WARN/Intent(1911):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-14 11:58:28.160: WARN/Intent(1911):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-14 11:58:28.160: WARN/Intent(1911):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-14 11:58:28.160: WARN/Intent(1911):     ... 19 more
</code></pre>

<p>I get this exception when try to pass my a serializable object to an intent</p>

<pre><code>package ams.gelato.api;

imports...
...


public class TaskScheduler implements ITaskScheduler{

    List&lt;Task&gt; tasks = new ArrayList&lt;Task&gt;();
    Context context = null;
    Intent intent= null;
    AlarmManager am = null;

    public TaskScheduler(Context c){
        context = c;
        intent = new Intent(context,TaskReceiver.class);
        am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    }

    @Override
    public boolean RunTaskAtTime(ITask _task, Date time) {
            Intent newIntent = new Intent(intent);
            newIntent.putExtra("task", new Task(_task));
            am.set(AlarmManager.RTC_WAKEUP, time.getTime(), PendingIntent.getBroadcast(context, 0, newIntent, PendingIntent.FLAG_UPDATE_CURRENT));
            return true;

    }

public static class Task implements ITask,Serializable{


    ITask task;

    public Task(ITask t){  
          task = t;
    }



    @Override
    public void runTask(){

    }
}
</code></pre>

<p>Here is the source code for my taskscheduler. the link in question is; <strong>newIntent.putExtra("task", new Task(_task));</strong> I am not sure why these exceptions are being thrown, could someone help me out?</p>
