<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Android組件之自定義ContentProvider

          Android組件之自定義ContentProvider

          作者: 時(shí)間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

          Uri uri = Uri

          本文引用地址:http://www.ex-cimer.com/article/201609/304417.htm

          .parse(content://com.example.googlecontentprovider.MyContentProvider/book/delete);

          ContentResolver resolver = getContext().getContentResolver();

          String where = id=?;

          String[] argString = {10};

          int count = resolver.delete(uri, where, argString);

          Log.i(BookCase, 刪除了 + count + 行);

          查詢所有的數(shù)據(jù):

          public void bookQuery() {

          Uri uri = Uri

          .parse(content://com.example.googlecontentprovider.MyContentProvider/book/query);

          ContentResolver resolver = getContext().getContentResolver();

          Cursor cursor=resolver.query(uri, new String[]{id,Name,Title}, null, null, null);

          if (cursor.getCount()>0) { String titleString=cursor.getString(cursor.getColumnIndex(Title));

          Log.i(BookCase, id+---+nameString+---+titleString);

          }

          }

          }


          上一頁 1 2 下一頁

          關(guān)鍵詞:

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();