Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when re-adding menu items (reloading UI) #1215

Closed
amannepid opened this issue Nov 8, 2019 · 0 comments
Closed

Issue when re-adding menu items (reloading UI) #1215

amannepid opened this issue Nov 8, 2019 · 0 comments

Comments

@amannepid
Copy link

amannepid commented Nov 8, 2019

Bug Report

I am getting below error when running the app in Actual Ford Card Head Unit with Sync3.

E/SdlProxy: 4.9.1: Result: INVALID_ID Info: null
 I/SdlProxy: 4.9.1: Finished sending main menu commands. Sending sub menu commands.
 I/SdlProxy: 4.9.1: RpcConverter Attempting to create com.smartdevicelink.proxy.rpc.AddCommandResponse
 E/SdlProxy: 4.9.1: Failed to send sub menu commands: null
 E/SdlProxy: 4.9.1: Error Sending Current Menu
 E/SdlProxy: 4.9.1: Failure handling protocol message: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' on a null object reference
    java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' on a null object reference
        at java.util.ArrayList.<init>(ArrayList.java:191)
        at com.smartdevicelink.managers.screen.menu.BaseMenuManager.setMenuCells(BaseMenuManager.java:177)
        at com.smartdevicelink.managers.screen.menu.MenuManager.setMenuCells(MenuManager.java:45)
        at com.smartdevicelink.managers.screen.menu.BaseMenuManager$8$1.onComplete(BaseMenuManager.java:953)
        at com.smartdevicelink.managers.screen.menu.BaseMenuManager$10.onError(BaseMenuManager.java:1054)
        at com.smartdevicelink.proxy.SdlProxyBase$92.onError(SdlProxyBase.java:4362)
        at com.smartdevicelink.proxy.SdlProxyBase.onRPCResponseReceived(SdlProxyBase.java:2230)
        at com.smartdevicelink.proxy.SdlProxyBase.handleRPCMessage(SdlProxyBase.java:2819)
        at com.smartdevicelink.proxy.SdlProxyBase.dispatchIncomingMessage(SdlProxyBase.java:1919)
        at com.smartdevicelink.proxy.SdlProxyBase.access$2700(SdlProxyBase.java:163)
        at com.smartdevicelink.proxy.SdlProxyBase$3.dispatch(SdlProxyBase.java:950)
        at com.smartdevicelink.proxy.SdlProxyBase$3.dispatch(SdlProxyBase.java:947)
        at com.smartdevicelink.Dispatcher.ProxyMessageDispatcher.handleMessages(ProxyMessageDispatcher.java:74)
        at com.smartdevicelink.Dispatcher.ProxyMessageDispatcher.access$000(ProxyMessageDispatcher.java:38)
        at com.smartdevicelink.Dispatcher.ProxyMessageDispatcher$1.run(ProxyMessageDispatcher.java:52)
        at java.lang.Thread.run(Thread.java:764)

The code that I use to reload UI is :

private fun clearUI() {
        sdlManager?.screenManager?.apply {
            softButtonObjects = arrayListOf()
            menu = arrayListOf()
        }
        createUI()
    }
private fun createUI(){
  sdlManager?.screenManager.menu = menuCellList
  sdlManager?.screenManager?.softButtonObjects = mainButtonList
}
OS & Version Information
  • Android Version: Samsung S9, Android
  • SDL Android Version: 4.9.1
  • Testing Against: Ford Car with Sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants