Get phone number of present incoming and outgoing call

后端 未结 2 1309
长发绾君心
长发绾君心 2020-12-19 18:05

I am making an app in which I have to retrieve the phone number and I am able to retrieve it but my problem is that I am getting phone number of las

2条回答
  •  半阙折子戏
    2020-12-19 18:12

    please modify your query with

     cur = context.getContentResolver().query(Calls.CONTENT_URI,
                            projection, null, null, Calls.DATE +" desc");
      cur.moveToFirst();
      s = cur.getString(numberColumn);
    

    it will give last call's phone number and there is no need requery so many times

提交回复
热议问题