Skip to main content
November 28, 2012
Question

How to access LayoutElements in Android (ANE)

  • November 28, 2012
  • 1 reply
  • 678 views

Hi!

I'm trying to integrate a googlemap-view in an native extension. iOS is fine, but I'm stuck at the Android-part. The map-component itself gets displayed correctly and loads the map-tiles as expected. But if I try to access any element from the xml-layout, the app crashes. The activity now has a static FREContext, which is set in the extension function like this:

public FREObject call(FREContext context, FREObject[] args) {

     ...

     MyMapActivity.freContext = context;

In the activity itself, I set the contentview in onCreate() like this:

setContentView( freContext.getResourceId("layout.activity_map"));

Works fine so far, but uppon accessing the map view, e.g.:

        mapView = (MapView)findViewById(R.id.mapview);

        mapView.setBuiltInZoomControls(true);

it crashes. This might be due to R not beeing accessable by the extension, but how to work around this? Any help would be really appreciated.

Thanx in advance,

Marcus

This topic has been closed for replies.

1 reply

chris.campbell
Legend
November 30, 2012

Hi Marcus,

Any chance we could get access to your app (and some sample code) so we can try to reproduce this internally?  If possible, please create a new bug report at bugbase.adobe.com and post back with the bug number.  I'll ask someone to investigate internally.  If you'd like to keep your code private, please feel free to send it to me directly at ccampbel@adobe.com.

Thanks,

Chris