Tuesday 15 June 2010

java - Eclipse giving error on code that shouldn't be there -


I am following this tutorial, but when I add code to eclipse, everywhere I "int" It is called "error can not be converted to the intel boolean", however it is in the code. How can I fix this without ruining the code or can I bypass that check? I have seen everything on the internet how to get the SMS and they are all the same. I get the same error code on the link tutorial:

I've searched the entire stack overflow, and the same error I found in every code Eclipse me.

Edit 6/23/13: Here is my code. I have fixed the problem of "I" int but now I get errors on 33, 35 and 41 lines. "Irrevocable code"

SMSReceiver:

  Import android.content.BroadcastReceiver; Import android.content.Context; Import android.content.Intent; Importroid.os.Bundle; Import android.telephony.SmsMessage; Public class SMSReceiver broadcasts broadcasts receivers {Private Static Last String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; Private World World; Public SMSReceiver (World Paramwold) {this.world = paramWorld; } Receiver on public null (reference paragraphext, intent parameter) {object [] arrayOfObject; SMS Message [] arrayOfSMSMessage; Int i; If (paramIntent.getAction (.) Equals ("android.provider.Telephony.SMS_RECEIVED")) {bundle localBundle = paramIntent.getExtras (); If (local bundle! = Null) {arrayOfObject = (object []) localBundle.get ("pdus"); ArrayOfSmsMessage = New SMS Message [arrayOfObject.length]; I = 0; If (i & lt; arrayOfObject.length) break label 68; If (arrayOfSmsMessage.length & lt; = -1) break label 90; }} Label68: label90: for (this.world.haveUnreadMessage = true ;; this.world.haveUnreadMessage = false) {return; ArrayOfSMSMessage [i] = SmsMessage.createFromPdu ((byte []) arrayOfObject [i]); I ++; break; }}}}    

If you are following the properly linked tutorial , So it seems that to be a problem in this line.

 for  (int i = 0; i & amp; lt; pdus.length; i ++) {  

& Amp; Lt; to & lt; Should be replaced with

No comments:

Post a Comment