on ‎2020 May 08 10:30 AM
Hi guys,
currently I develop an MDK application in Visual Studio Code using your MDK extension for VSC.
I added the extension you created from: https://developers.sap.com/tutorials/cp-mobile-dev-kit-map-extension.html. Note, that I didn't change any code, its the same version posted in the tutorial.
For iOS, the map works as expected, but for Android, I recognized some issue. I checked for your documentation (https://help.sap.com/viewer/977416d43cd74bdc958289038749100e/3.2/en-US/9411d35cb91a4a8986a2635b7375c...) and analogue to it, the Map extension tries to create a new instance for the "_mapView" variable (object of class MapView):
this._mapView = new com.google.android.gms.maps.MapView(this.androidContext());
This line, however, throws a java.lang.NullPointerException, because the context of android (this.androidContext()) is null for me.
In the second link I posted above, the following information is delivered about the androidContext:
androidContext() - this function returns the current page's context that will be needed to create an Android native view.
Do you have any idea, why this problem occurs? Do I maybe have to adjust something, since, e.g., the mdk client sdk has been changed? In my TypeScript-file, the current android context is null and that is why I think, that the NullPointerException is thrown.
Thank you in advance for your help!
Best regards,
Sher-Chan Kodirov
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
hi jitendrakumar.kansal,
for your info, I found the solution. After I exchanged the "this.androidContext()" with app.android.context in the code of your tutorial (for the map extension), I was finally able to display the correct result.
BR,
Sher-Chan Kodirov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Object {constructor: , _needRestart: false, _callbacks: ActivityCallbacksImplementation}
_callbacks:ActivityCallbacksImplementation {_rootView: Frame}
_needRestart:false
constructor:function () { … }
isNativeScriptActivity:true
skipExit:undefined
super:Object
__proto__:Activity {constructor: }
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.