title: App does not display the call log after allowing android.permission.READ_CALL_LOG once
body: <p>// READ_CALL_LOG permission works only once after first installation of the app. when I install it again from android studio the permission does not appear and the app does not read the call logs. This also happens after installing the app and closing it. after opening it again, the call logs disappeared. I also call this activity from another login activity</p>
  <p>//   My AndroidManifest</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
      &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
          package=&quot;com.example.calllog&quot;&gt;
      
          &lt;uses-permission android:name=&quot;android.permission.READ_CALL_LOG&quot; /&gt;
          &lt;uses-permission android:name=&quot;android.permission.WRITE_CALL_LOG&quot;/&gt;
      
          &lt;application
              android:allowBackup=&quot;true&quot;
              android:icon=&quot;@drawable/img&quot;
              android:label=&quot;@string/app_name&quot;
              android:roundIcon=&quot;@drawable/img&quot;
              android:supportsRtl=&quot;true&quot;
              android:theme=&quot;@style/Theme.CallLog&quot;
              android:usesCleartextTraffic=&quot;true&quot;&gt;
              &lt;activity
                  android:name=&quot;.HomeActivity&quot;
                  android:exported=&quot;true&quot; &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
      
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
              &lt;/intent-filter&gt;
              &lt;/activity&gt;
              &lt;activity
                  android:name=&quot;.MainActivity2&quot;
                  android:exported=&quot;false&quot; /&gt;
              &lt;activity
                  android:name=&quot;.MainActivity&quot;
                  android:exported=&quot;false&quot;&gt;
      
              &lt;/activity&gt;
      
           &lt;/application&gt;
      
      &lt;/manifest&gt;
     
  </code></pre>
  <p>//My MainActivity</p>
  <pre><code>   //MainActivity
  
  class MainActivity : AppCompatActivity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
  
          if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_CALL_LOG) != PackageManager.PERMISSION_GRANTED) {
              ActivityCompat.requestPermissions(this, arrayOf(android.Manifest.permission.READ_CALL_LOG), 101)
              displayLog()
          }
  
      }
  
      private fun displayLog() {
          var cols= arrayOf(CallLog.Calls._ID, CallLog.Calls.NUMBER, CallLog.Calls.TYPE, CallLog.Calls.DURATION,CallLog.Calls.DATE)
          var rs=contentResolver.query(CallLog.Calls.CONTENT_URI,cols,null,null, &quot;${CallLog.Calls.LAST_MODIFIED} DESC&quot;)
          var from= arrayOf(CallLog.Calls.NUMBER,CallLog.Calls.DURATION,CallLog.Calls.TYPE)
          val adapter=SimpleCursorAdapter(this, R.layout.mylayout,rs,from, intArrayOf(R.id.textView1,R.id.textView2,R.id.textView3),0)
          val listview=findViewById&lt;ListView&gt;(R.id.listview) as ListView
          listview.adapter=adapter
      }
  
  
  
      override fun onRequestPermissionsResult(requestCode: Int, permissions: Array&lt;out String&gt;, grantResults: IntArray) {
          super.onRequestPermissionsResult(requestCode, permissions, grantResults)
          if(requestCode==101 &amp;&amp; grantResults[0]==PackageManager.PERMISSION_GRANTED) {
              displayLog()
          }
      }
  }
  </code></pre>