{"record":{"id":"c136a22caea3f709","repo":"microg/GmsCore","slug":"oninflate-not-allowed-on-streetviewpanoramaviewdel","errorCode":null,"errorMessage":"onInflate not allowed on StreetViewPanoramaViewDelegate","messagePattern":"onInflate not allowed on StreetViewPanoramaViewDelegate","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"play-services-maps/src/main/java/org/microg/gms/maps/StreetViewPanoramaViewDelegate.java","lineNumber":68,"sourceCode":"    }\n\n    @Override\n    public void onDestroy() {\n        try {\n            delegate.onDestroy();\n        } catch (RemoteException e) {\n            throw new RuntimeRemoteException(e);\n        }\n    }\n\n    @Override\n    public void onDestroyView() {\n        throw new UnsupportedOperationException(\"onDestroyView not allowed on StreetViewPanoramaViewDelegate\");\n    }\n\n    @Override\n    public void onInflate(@NonNull Activity activity, @NonNull Bundle options, @Nullable Bundle onInflate) {\n        throw new UnsupportedOperationException(\"onInflate not allowed on StreetViewPanoramaViewDelegate\");\n    }\n\n    @Override\n    public void onLowMemory() {\n        try {\n            delegate.onLowMemory();\n        } catch (RemoteException e) {\n            throw new RuntimeRemoteException(e);\n        }\n    }\n\n    @Override\n    public void onPause() {\n        try {\n            delegate.onPause();\n        } catch (RemoteException e) {\n            throw new RuntimeRemoteException(e);\n        }","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-maps/src/main/java/org/microg/gms/maps/StreetViewPanoramaViewDelegate.java#L50-L86","documentation":"StreetViewPanoramaViewDelegate.onInflate(Activity, Bundle, Bundle) is intentionally unsupported: XML attribute inflation is handled by StreetViewPanoramaView's constructor or the panorama fragment. Invoking it on the delegate throws UnsupportedOperationException unconditionally.","triggerScenarios":"Calling delegate.onInflate(activity, options, savedInstanceState), or a Fragment.onInflate forwarding attributes to the delegate, or XML inflation combined with manual delegate lifecycle driving.","commonSituations":"XML-declared Street View views with custom Fragment plumbing, code ported from other GMS delegate implementations, or migration from Google Maps SDK internals.","solutions":["Do not call onInflate on the delegate; pass StreetViewPanoramaOptions to the StreetViewPanoramaView constructor instead.","Use StreetViewPanoramaFragment/SupportStreetViewPanoramaFragment for XML/fragment embedding.","Remove onInflate forwarding from custom Fragment wrappers.","Build options programmatically (new StreetViewPanoramaOptions().position(...)) rather than via inflation."],"exampleFix":"// before\n@Override\npublic void onInflate(Activity a, Bundle opts, Bundle s) {\n    delegate.onInflate(a, opts, s); // always throws\n}\n// after\n@Override\npublic void onInflate(Activity a, Bundle opts, Bundle s) {\n    panoramaOptions = new StreetViewPanoramaOptions(); // build from your own attribute parsing\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"public static boolean supportsInflate(LifecycleDelegate d) {\n    return !(d instanceof StreetViewPanoramaViewDelegate);\n}","tryCatchPattern":"try {\n    delegate.onInflate(activity, options, savedInstanceState);\n} catch (UnsupportedOperationException e) {\n    // build StreetViewPanoramaOptions yourself or use the fragment\n}","preventionTips":["Pass StreetViewPanoramaOptions to the view constructor instead of relying on delegate inflation.","Use StreetViewPanoramaFragment/SupportStreetViewPanoramaFragment for XML embedding.","Never forward Fragment.onInflate to the panorama delegate.","Construct options programmatically (position, pano id, orientation) in code."],"tags":["android","maps","street-view","unsupported-operation","lifecycle"],"backgroundTag":"unsupported-operation","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}