Xamarin Android Notepad (iii) pruning

Source: Internet
Author: User

I do not have to do too much of the explanation, the data before the operation also cited examples, here directly paste the deletion and modification of the code.

  Public Override BOOLonoptionsitemselected (Imenuitem item) {Switch(item. ItemId) { Case 1: {Android.App.AlertDialog.Builder Builder=NewAlertdialog.builder ( This); Alertdialog AD=Builder.                        Create (); Ad. Settitle ("whether to delete"); Ad. Setbutton ("is a", (s, e) = ={Sqlite DBHelper=NewSqlite ( This); Sqlitedatabase DB=dbhelper.writabledatabase; Contentvalues NCV=Newcontentvalues (); varNID = Intent.getstringextra ("ID"); NCv. Put ("Context", Edtext.                            Text); Db. Delete ("Notebooksql","_id =?",New string[] {NID.                            ToString ()}); varIntentAct2 =NewIntent ( This,typeof(Activity1));                            StartActivity (INTENTACT2); Toast.maketext ( This,"has been removed", Toastlength.short).                            Show ();  This.                                                   Finish ();                        }); Ad. SetButton2 ("No", (s, e) = = { }); Ad.                                            Show (); }  Break;  Case 2: {Sqlite dbhelper=NewSqlite ( This); Sqlitedatabase DB=dbhelper.writabledatabase; Contentvalues NCV=Newcontentvalues (); varNID = Intent.getstringextra ("ID"); NCv. Put ("Context", Edtext.                         Text); Db. Update ("Notebooksql", NCV,"_id =?",New string[] {NID.                         ToString ()}); varIntentAct2 =NewIntent ( This,typeof(Activity1));                         StartActivity (INTENTACT2); Toast.maketext ( This,"has been saved", Toastlength.short).                         Show ();  This.                     Finish (); } Break;  CaseAndroid.Resource.Id.Home: {varIntent =NewIntent ( This,typeof(Activity1));                        StartActivity (Intent);  This.                    Finish (); }  Break; }            return true; }

As follows

Xamarin Android Notepad (iii) pruning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.