title: Get phone number of present incoming and outgoing call
body: <p>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 <strong>phone number</strong> of <strong>last call</strong> rather than <strong>present call</strong>.My code is as follows:</p>
  
  <pre><code>projection = new String[]{Calls.NUMBER};
  cur = context.getContentResolver().query(Calls.CONTENT_URI, projection, null, null, null);
  cur.requery();
  numberColumn = cur.getColumnIndex(Calls.NUMBER);
  cur.requery();
  cur.requery();
  cur.requery();
  cur.requery();
  cur.moveToLast();
  s = cur.getString(numberColumn);
  String pathname = "/sdcard/" + s + ".amr";
  </code></pre>