runtimeexception

Java - How to throw RuntimeException

I'm trying to throw an exception in my code like this: throw RuntimeException(msg); But when I build in NetBeans I get this error: C:\....java:50: cannot find symbol symbol : method RuntimeException(java.lang.String) location: class ... throw RuntimeException(msg); 1 error Do I need to import something? Am I misspelling i...

Please explain RuntimeException in Java and where it should be used.

I am following this great discussion at SO, titled: The case against checked exceptions , but I am unable to follow where exactly RuntimeException should be used and how it is different from normal Exceptions and its subclasses. Googling gave me a complex answer, that is, it should be used to deal with programming logic errors and should...

RuntimeException on widget that has a Bitmap (Android)

Hi, my app has widgets that have an ImageView and a TextView. On the onUpdate() method of the WidgetProvider, I put a Bitmap inside the ImageView this way: Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.widget_btn); Bitmap bitmap2 = BitmapManager.setColor(bitmap, red, green, blue); views.setImageViewBit...

Calling startActivity() from outside of an Activity?

Hi all, I'm using an AlarmManager to trigger an intent that broadcasts a signal. The following is my code: AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent i = new Intent(this, Wakeup.class); try { PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, 0); Long elapse...

what is the bug in this android layout xml chunk

Hi, When I try to debug my app I get a runtimeexception when I include this xml in my layout. I cannot see what is wrong with it, can you? I am using android eclipse plugin, eclipse 3.5.2, with the latest android plugin and the latest java 6...21 on winxppro 32 bit sp3 Thank you. <ImageButton android:id="@+id/map_button" android...