View Single Post
Old 04-04-2008, 12:50 PM   #1 (permalink)
lionscribe
Knows Where the Search Button Is
 
Join Date: Feb 2008
Model: none
Carrier: sprint
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post Problem class not found (Update to thread)

Please Login to Remove!

Unfortunately the thread "Problem class not found" got lost during the recent Server Meltdown, and thread itself is not found )
But since I came up with a solution, I will state the original problem, and follow that with a solution.

Problem: When the developer wants to add an optional class to his project that is only available in let's say BB version 4.2, but he wants his application to work on 4.1, so the assumed solution would be to put the call to that class in a try-catch, and compile it in JDE 4.2

For example if the developer wants to add the Blackberry Map Class to his project, which is only available in 4.2, he may want to do the following

try
{
MapsArguments args = new MapsArguments((Contact)contact ,0);
Invoke.invokeApplication( Invoke.APP_TYPE_MAPS, args);
}
catch (ClassNotFoundException e)
{
Dialog.notify("Your Device does not support this option");
}

The problem is that this does NOT work, because when you launch the application, JVM throws a ClassNotFoundException before the application runs, and you have no chance to catch it.

This was the original problem posted by someone, and there were quite a few replies, but with no solution. I will post a solution in the next Post.

Lionscribe
Offline   Reply With Quote