Mavzu: Android ilovada Service komponentasi. Reja: Kontaktlar bilan ishlash. Kontaktlar qo'shililishi. Kontent provayderni yaratish. Json bilan ishlash


if(hasReadContactPermission == PackageManager.PERMISSION_GRANTED){


Download 55.47 Kb.
bet4/4
Sana22.06.2023
Hajmi55.47 Kb.
#1647396
1   2   3   4
Bog'liq
6-Mavzu (2)

if(hasReadContactPermission == PackageManager.PERMISSION_GRANTED){

  • if(hasReadContactPermission == PackageManager.PERMISSION_GRANTED){
  • READ_CONTACTS_GRANTED = true;
  • }
  • else{
  • // ruxsatnomalarni o'rnatish uchun muloqot oynasiga murojaat qilamiz
  • ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_CODE_READ_CONTACTS);
  • }
  • // agar ruxsat o'rnatilgan bo'lsa, kontaktlarni yuklaymiz
  • if (READ_CONTACTS_GRANTED){
  • loadContacts();
  • }
  • }
  • @Override
  • public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults){
  • if (requestCode == REQUEST_CODE_READ_CONTACTS)

E’tiboringiz uchun rahmat


Download 55.47 Kb.

Do'stlaringiz bilan baham:
1   2   3   4




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling