Skip to main content
December 5, 2012
Question

How to addContentView from Native Extension

  • December 5, 2012
  • 1 reply
  • 917 views

Hi!

We're currently (still) working at a NativeExtension to show a GoogleMap in Android. What works so far is showing the map as a newActivity. But that doesn't suffice, as only the map or the underlying air-app can accept touch-events this way (If I'm wrong, please DO correct me). So I'm currently trying to add the view containing the map via addContentView to the air-app itself, but so far, no success. I'm assuming, that the whole air-app is only one activity. I'm trying this in the extension's onCreate-method:

                    View extensionview = LayoutInflater.from(context.getActivity().getBaseContext()).inflate(

                                        context.getResourceId("layout.activity_map"), null);

   

                    context.getActivity().addContentView(extensionview, new ViewGroup.LayoutParams(

                ViewGroup.LayoutParams.FILL_PARENT,

                ViewGroup.LayoutParams.FILL_PARENT));

where context is the FREContext from the function parameter. Doesn't work, any ideas, where the error is here?

Any hints appreciated!

Thanx, Marcus

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

chris.campbell
Legend
December 11, 2012

I've forwarded this to our Android team for their review.

Chris