I'm trying to wrap the PanoramaGL library.
This requires that the PLView class is used instead of the 'standard' android Activity class.
PLView extends Activity.
So in my b4a activity module i use the attribute:
I'm unable to get any panorama to display.
Even reproducing the very simple java example in b4a displays nothing.
This is the very simple java example:
I created a new java android project using Android Studio, imported the android library files and tried the above example.
I see a panorama displayed.
I think the problem is that b4a uses the PLView but set's a BALayout as the activity's 'ContentView', my compiled b4a activity source code shows in onCreate():
b4a is i think overwriting the GLSurfaceView created by PLView.
No exceptions are raised and my b4a activity silently fails to render it's panorama.
Instead i see just the empty BALayout.
Is there a solution for this?
Can i prevent b4a from calling setContentView?
This requires that the PLView class is used instead of the 'standard' android Activity class.
PLView extends Activity.
So in my b4a activity module i use the attribute:
B4X:
#Extends: com.panoramagl.PLView
I'm unable to get any panorama to display.
Even reproducing the very simple java example in b4a displays nothing.
This is the very simple java example:
B4X:
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
PLSpherical2Panorama panorama = new PLSpherical2Panorama();
panorama.setImage(new PLImage(PLUtils.getBitmap(this, R.raw.spherical_pano), false));
this.setPanorama(panorama);
}
I created a new java android project using Android Studio, imported the android library files and tried the above example.
I see a panorama displayed.
I think the problem is that b4a uses the PLView but set's a BALayout as the activity's 'ContentView', my compiled b4a activity source code shows in onCreate():
B4X:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFirst) {
processBA = new BA(this.getApplicationContext(), null, null, "uk.co.martinpearman.b4a.panoramaglexample", "uk.co.martinpearman.b4a.panoramaglexample.main");
processBA.loadHtSubs(this.getClass());
float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
BALayout.setDeviceScale(deviceScale);
}
else if (previousOne != null) {
Activity p = previousOne.get();
if (p != null && p != this) {
BA.LogInfo("Killing previous instance (main).");
p.finish();
}
}
processBA.runHook("oncreate", this, null);
if (!includeTitle) {
this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
}
if (fullScreen) {
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,
android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
mostCurrent = this;
processBA.sharedProcessBA.activityBA = null;
layout = new BALayout(this);
setContentView(layout);
afterFirstLayout = false;
BA.handler.postDelayed(new WaitForLayout(), 5);
}
b4a is i think overwriting the GLSurfaceView created by PLView.
No exceptions are raised and my b4a activity silently fails to render it's panorama.
Instead i see just the empty BALayout.
Is there a solution for this?
Can i prevent b4a from calling setContentView?