Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse giving error on code that shouldn't be there
    primarykey
    data
    text
    <p>I am following this tutorial but when I add the code to eclipse, everywhere the "i" int is called, eclipse gives the error "int cannot be converted to a boolean". Yet that is how it is in the code. How can I fix this without ruining the code or can I bypass that check? I've looked all over the internet on how to recieve sms and they all are the same. I get the same error in the code. Here's the link to the tutorial:</p> <p><a href="http://shreymalhotra.me/blog/tutorial/receive-sms-using-android-broadcastreceiver-inside-an-activity/#comment-693" rel="nofollow">Receive SMS tutorial</a></p> <p>I've searched all over stack overflow as well and every code I've found gives me the same error in eclipse.</p> <p>EDIT 6/23/13: Here's my code. I've fixed the "i" int issue but now I'm getting errors on lines 33, 35, and 41. "Unreachable code"</p> <p>SMSReceiver:</p> <pre><code>import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.SmsMessage; public class SMSReceiver extends BroadcastReceiver { private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; private World world; public SMSReceiver(World paramWorld) { this.world = paramWorld; } public void onReceive(Context paramContext, Intent paramIntent) { Object[] arrayOfObject; SmsMessage[] arrayOfSmsMessage; int i; if (paramIntent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) { Bundle localBundle = paramIntent.getExtras(); if (localBundle != null) { arrayOfObject = (Object[])localBundle.get("pdus"); arrayOfSmsMessage = new SmsMessage[arrayOfObject.length]; i = 0; if (i &lt; arrayOfObject.length) break label68; if (arrayOfSmsMessage.length &lt;= -1) break label90; } } label68: label90: for (this.world.haveUnreadMessage = true; ; this.world.haveUnreadMessage = false) { return; arrayOfSmsMessage[i] = SmsMessage.createFromPdu((byte[])arrayOfObject[i]); i++; break; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload