This week's book giveaway is in the Game Development forum.
We're giving away four copies of Badass: Making Users Awesome and have Kathy Sierra on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Instanceof TextMessage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Instanceof TextMessage" Watch "Instanceof TextMessage" New topic

Instanceof TextMessage

Steve Heasman

Joined: Feb 14, 2011
Posts: 3

Hi Guys

I am hoping someone can see what I cant in this code I have one phone sending a string in a sms to another below is the code for the sending of the text message

Pretty Straight forward the second phone does get the message but at present doesn't see the message as a instance of TextMessage the code for receiving is below

I put some System prints in their to see where it was getting to so i know it fails at if (msg instanceof TextMessage)

Any ideas ?



Steve Heasman - Bsc Computer Science Student, Teesside University
Vijay Dogra

Joined: Sep 16, 2004
Posts: 22
I do not see anything wrong in your code, unless the imports are not proper.
It is sorta covered in the JavaRanch Style Guide.
subject: Instanceof TextMessage