示例#1
0
        private async void PhonebookUpdateRecordGBtn_Clicked(object sender, EventArgs e)
        {
            try
            {
                Log.Debug(Globals.LogTag, "Pb update record call start");
                PhonebookRecord pbRec = await pb.ReadPhonebookRecord(PhonebookType.Usim, 1);

                Log.Debug(Globals.LogTag, "Read record Index: " + pbRec.Index);
                Log.Debug(Globals.LogTag, "Read record Name: " + pbRec.Name);
                Log.Debug(Globals.LogTag, "Read record Number: " + pbRec.Number);
                PhonebookRecord rec = new PhonebookRecord();
                rec.Type   = PhonebookType.Usim;
                rec.Index  = 1;
                rec.Name   = "NewName";
                rec.Number = "999999";
                bool b = await pb.UpdatePhonebookRecord(rec);

                if (b)
                {
                    Log.Debug(Globals.LogTag, "Pb record updated successfully");
                }

                PhonebookRecord pbUpdt = await pb.ReadPhonebookRecord(PhonebookType.Usim, rec.Index);

                Log.Debug(Globals.LogTag, "Updated record Name: " + pbUpdt.Name);
                Log.Debug(Globals.LogTag, "Updated record Number: " + pbUpdt.Number);
                Log.Debug(Globals.LogTag, "Updated update record call success");
            }

            catch (Exception ex)
            {
                Log.Debug(Globals.LogTag, "Pb update record exception: " + ex.ToString());
            }
        }