0

I am trying to write an Android app using Xtend, however, I am more or less new in both. I have created a couple of Android examples with Java, but I'm still learning.

In these apps i used the android.app.Instrumentation.ActivityMonitor in order to check that an Activity had started. I have read that Xtend does not support Nested classes

No var args, no nested classes, no anonymous classes? Those language features are not mentioned in the docs, and I could not guess a valid syntax. >I assume they are not available, but I could be wrong. http://blogs.atlassian.com/2011/11/xtend-first-impressions/

Does this mean the ActivityMonitor cannot be accessed when using Xtend or am I just doing something wrong?

Causteau
  • 117
  • 1
  • 10
  • For completeness [this question](http://stackoverflow.com/questions/8026675/how-can-i-use-eclipses-new-xtend-language-in-my-android-project?rq=1) is related and goes into even more detail – Causteau Mar 28 '13 at 20:55

1 Answers1

0

It depends how you used the ActivityMonitor. You cannot define inner classes on your own right now, but static inner classes can be accessed from within Xtend. There are issues with non-static inner classes. The syntax is different to Java, though. Instead of the '.' dot as the delimiter of declaring class and inner class, Xtend uses the '$'. A respective import declaration can ease the pain, here, e.g. import android.app.Instrumentation$ActivityMonitor.

Sebastian Zarnekow
  • 6,609
  • 20
  • 23
  • Thanks Sebastian! Hadn't seen the $ before. Not sure why eclipse didn't add that when I clicked on the import quick fix suggestion - before it was just doing nothing, but seems to be working again. Cheers – Causteau Mar 26 '13 at 21:03