Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top