hbuilderx呼叫儀表的 provider

語言: CN / TW / HK
    function getMainActivity(){
        //拿到activity
        var mainActivity = plus.android.runtimeMainActivity();
        //拿到contentResolver
        var contentResolver=plus.android.invoke(mainActivity,"getContentResolver");
        //獲取uri
        var uri=plus.android.invoke("android.net.Uri","parse","content://com.genius.meterpointreader.provider.reads/");
        //拿到cursor
        var cursor= null;
        cursor = plus.android.invoke(contentResolver,"query",uri,["file:///storage/emulated/0/Android/data/doc/yb01.jpg","0.3","0.0022222222222","0.8"],null, null,null);
        // //迴圈取資料
        if(plus.android.invoke(cursor,"moveToFirst")){
            do{
                var ret=plus.android.invoke(cursor,"getColumnIndex","ret");//拿到要取的欄位所在列
                var ret=plus.android.invoke(cursor,"getString",ret);//取值
                return ret;
            }while(false);
        }else{
            alert('NNNN');
        }
    }