android - Can I use NativeActivity with ActivityGroup? -
android - Can I use NativeActivity with ActivityGroup? -
i know activitygroup
deprecated.
but trying combine user interface of nativeactivty
java/android api view
s.
i trying create 1 hybrid user interface part of screen nativeactivity
.
i used example , tried activitygroup
simple activities.
this work activity
(even if play video using videoview).
but when tried load nativeactivity
not working. (i tried teapot demo ndk samples).
by "not working" mean window.getdecorview()
native activity homecoming transparent view, not actual content view.
how should it? please help me.
this time found workaround it, , works fine. ndk demos.
on activitygroup sub class oncreate method, write next code.
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); localactivitymanager lam = getlocalactivitymanager(); intent intent = new intent(); intent.setclass(this, teapotnativeactivity.class); window window = lam.startactivity("xxx", intent); // reflect phone call "willyoutakethesurface" nativeactivity callback = javacalls.callmethod(window.getdecorview(), "willyoutakethesurface"); if (callback != null) { window.takesurface(null); getwindow().takesurface(callback); getwindow().takeinputqueue(callback); } setcontentview(window.getdecorview()); }
android android-layout android-ndk activitygroup native-activity
Comments
Post a Comment