I've just started learning how to develop applications for Android. Currently, I am using Eclipse 4.2 (Juno) as the IDE. The problem is I can't see a normal way to view exceptions that are happening in my own code. For example:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<BasicObject> objects = _objectRepository.GetAllObjects();
Iterator<BasicObject> iterator = objects.iterator();
while(iterator.hasNext())
{
ObjectListItemView itemView= new ObjectListItemView(this,iterator.next());
}
}
At the time when onCreate
is running, _objectRepository is null and so the NullReference is thrown. After that Eclipse displays "Source not found", which is really not what I expect. Then I press F8 (continue) multiple times; the process exits and the debugger stops. And only after that can I see some stacktrace in LogCat (from where it's really hard to navigate to my own code).
As you can see, all this process of catching exceptions is really time-consuming. Is there any other way to view exceptions and what am I doing wrong?
I am not using an Android emulator, I am using a real device (HTC Desire S). I already have LogCat, but I'd like something more handy/practical.
To illustrate, in Visual Studio I can see an exception while debugging. Visual Studio sets a break on the line where the exception occurred and I can view any information I want (stack trace local variables, all stuff actually) in the exception window (see The {not much utilized} Debug->Exceptions… window technique).
In Eclipse I got exception details in LogCat (which is very uncomfortable to use) and only after the debugger is stopped.