انجمن سایت کلیدستان


رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
تغییر شماره تماس در contacts (در برنامه نویسی اندروید)

تغییر شماره تماس در contacts (در برنامه نویسی اندروید)

#1
سلام
من به کمک کلاس ContactsContract به شماره تماس ها دسترسی دارم و میتونم اونا رو نمایش بدم ولی مشکل اینه که با این کلاس آشنایی زیادی ندارم و تازه کارم رو باش شروع کردم و خواستم ببینم با این کلاس میشه شماره ها رو تغییر داد یا باید از کلاس و روش دیگه ای استفاده کنم ؟؟؟

لطفا کمک کنید .... ممنون
پاسخ

تغییر شماره تماس در contacts (در برنامه نویسی اندروید)

#2
سلام این کد برای تغییر یک مخاطب :

کد پی‌اچ‌پی:
    // The Cursor that contains the Contact row
    public Cursor mCursor;
    // The index of the lookup key column in the cursor
    public int mLookupKeyIndex;
    // The index of the contact's _ID value
    public int mIdIndex;
    // The lookup key from the Cursor
    public String mCurrentLookupKey;
    // The _ID value from the Cursor
    public long mCurrentId;
    // A content URI pointing to the contact
    Uri mSelectedContactUri;
    ...
    /*
     * Once the user has selected a contact to edit,
     * this gets the contact's lookup key and _ID values from the
     * cursor and creates the necessary URI.
     */
    // Gets the lookup key column index
    mLookupKeyIndex mCursor.getColumnIndex(Contacts.LOOKUP_KEY);
    // Gets the lookup key value
    mCurrentLookupKey mCursor.getString(mLookupKeyIndex);
    // Gets the _ID column index
    mIdIndex mCursor.getColumnIndex(Contacts._ID);
    mCurrentId mCursor.getLong(mIdIndex);
    mSelectedContactUri =
            Contacts.getLookupUri(mCurrentIdmCurrentLookupKey);

    // Creates a new Intent to edit a contact
    Intent editIntent = new Intent(Intent.ACTION_EDIT);
    /*
     * Sets the contact URI to edit, and the data type that the
     * Intent must match
     */
    editIntent.setDataAndType(mSelectedContactUri,Contacts.CONTENT_ITEM_TYPE); 

منبع : http://developer.android.com/training/co...ditContact

موفق باشید
پاسخ
 سپاس شده توسط download69 ، admin

تغییر شماره تماس در contacts (در برنامه نویسی اندروید)

#3
سلام ممنون
ولی این روش جالبی نیست من روشی برای آپدیت کل کنتکت ها میخوام.
با استفاده از این واسه همه ی کنتکت ها یه ایونت باز میشه که خوده یوزر باید تغییرش بده
پاسخ
 سپاس شده توسط شماره مجازی امارات ، تلگرام ضد فیلتر 2023


پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان