how add limit clause to manageQuery on android

前端 未结 5 1910
没有蜡笔的小新
没有蜡笔的小新 2021-02-10 03:00

Android\'s API provides a clean mechanism via SQLite to make queries into the contact list. However, I am not sure how to limit the results:

Cursor cur = ((Acti         


        
5条回答
  •  心在旅途
    2021-02-10 03:26

    You can specify the "limit" parameter in the "order" parameter, maybe even inside other parameters if you don't want to sort, because you'll have to specify a column to sort by then:

    mContentResolver.query(uri, columnNames, null, null, "id LIMIT 1");
    

提交回复
热议问题