I try to add a content view from inside a native extension to the current activity like so:
// context is the current FREContext
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));
If I start a new activity, it’s displayed correctly. I just can’t use that approach, as the underlying activity is paused. So I’d like to add the view as new content view to the current activity. The view is not displayed, but doesn’t throw any errors either. Any hints what’s the fault here?
Thanx in advance,
Marcus
You have to make the extra effort and use the ressourceId, as it’s available from the extension context (as opposed to the generated resources, that aren’t).
Hope, this helps someone.