InstantiationException occurs when an exception is thrown out of a
constructor.  Generally there should be another exception reported as
causing the InstantiationException, and the stack trace should point
to the specific lines that are in error.  Stack trace is your friend,
and you should be grateful -- their are poor children programming on
Symbian devices who have no stack trace.

On Jul 29, 11:24 am, Wall-E <bashee...@gmail.com> wrote:
> I am trying to start an IntentService inside my Broadcast Receiver
> ( so inside of onReceive() ):
>
>     public class SmsMessageReceiver extends BroadcastReceiver
>     {
>         .
>         .
>         .
>         public void onReceive(.....)
>         {
>              .
>              .
>              .
>              Intent mServiceIntent = new Intent(context,
> SmsParserService.class );
>              mServiceIntent.putExtra("phoneNumber", fromAddress);
>              mServiceIntent.putExtra("smsMessage",
> message.getMessageBody());
>                context.startService(mServiceIntent);
>         }
>
>     }
>
>     So if I change the IntentService class to a regular Service class,
> although it has funny behavior, it still goes into the
> onStartCommand(...) and onCreate() methods, but for the IntentService,
> before going into any of those methods it throws an
> InstantiationException and in the detailMessage it just says
> "com.tvismobile.SmsParserService" which is what my Service is labeled
> as in the Manifest file.
>
> Is there something special you have to do to get IntentService
> started?
>
> Any help is appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to