Share Invoke is sometimes blank

浪尽此生 提交于 2019-12-25 04:22:34

问题


I have a strange bug using a share invoke.

About 1 in 3 attempts to share will result in no text being shared. Usually the first share will work but further attempts will not work. Randomly it will start working again. This happens with bbm, facebook and twitter apps.

The following code is part of a listview listitem.

        InvokeActionItem {
            id: invokeActionItem
            title: "Share"
            ActionBar.placement: ActionBarPlacement.OnBar
            imageSource: "asset:///Images/Icons/share_icon.png"
            query {
                mimeType: "text/plain"
                invokeActionId: "bb.action.SHARE"
            }
            onTriggered: {
                query.data = "I just read this and had to share it: " + ListItemData.title + ". ";
                query.data += "Read it here " + ListItemData.shareUrl;
                query.updateQuery();
            }
        }

Has anyone got any ideas what could be causing the issue or how to solve it?


回答1:


Invocation is unfortunately broke in QML (works only for text sometimes). You will need to use C++ for it (it works well there)



来源:https://stackoverflow.com/questions/22250650/share-invoke-is-sometimes-blank

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!