I can't send sms from my program, it gives me "jvm error: 104 uncaught: throwable" error in simulator after sending the sms and tapping the back button to go back to the application.
I'm using jde 4.5.0 with 8330 simulator.
I wrote a sample program to send an sms and it's the same error, i hope someone can tell me whats wrong.
App.java:
Code:
import net.rim.device.api.ui.UiApplication;
public class App extends UiApplication
{
Screen2 screen2;
public static void main(String[] args)
{
App app = new App();
app.enterEventDispatcher();
}
public App()
{
screen2 = new Screen2();
pushScreen(screen2);
}
} Screen2.java:
Code:
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.TextMessage;
import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.MessageArguments;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
final class Screen2 extends MainScreen
{
public Screen2()
{
super();
setTitle(new LabelField("Screen2"));
try
{
String number = "1234";
MessageConnection mc = (MessageConnection)Connector.open("sms://");
TextMessage textMessage = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE);
textMessage.setAddress("sms://" + number);
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(textMessage));
}
Catch(Throwable e)
{
Dialog.alert(e.getMessage());
}
}
} stack trace is :
Code:
Thread [net_rim_bb_messaging_app(52)id=1076822016] (Suspended (exception Throwable))
UnreadCount$NewAndUnreadCount.modifyUnreadCount(int, boolean, boolean, boolean) line: 504
UnreadCountManager.internalModifyUnreadCount(int, int, boolean, boolean) line: 371
UnreadCountManager.internalModifyUnreadCount(int, int, boolean, boolean) line: 365
UnreadCountManager.modifyUnreadCount(int, int, boolean, boolean) line: 185
UnreadCountManager.decrementUnreadCount(int, boolean, boolean) line: 133
SMSModel.decrementCount(boolean, boolean) line: 848
SMSMessageModel(SMSModel).perform(long, Object) line: 977
MessageBulkMarkOldManager.markOld(Object) line: 207
MessageBulkMarkOldManager$Worker.run() line: 268
Thread.run() line: 379
the exception only happens with os 4.5.0 in os 4.2.1 everything ok.