Android Personal Finance Tool Six: Show billing details under _android

Source: Internet
Author: User

On the show billing detail in the previous section, Bill details of the display has been basically implemented, this article mainly to organize the code, to achieve this window query and delete functions; When the menu is pressed, the window of the selected month is displayed, and the month of detail is selected; on the ListView, press the dialog box that pops up to confirm deletion to complete the deletion.

The following figure:

There is a Onitemlongclicklistener event in this case, and the use of this event is as follows:

First the activity inside implements Onitemlongclicklistener, and then as written in the following code:

Java code

//here ListView Add listening Event Lv.setonitemlongclicklistener (this); Handling Delete actions in the activity's Onitemlongclick event public boolean Onitemlongclick (adapterview<?> parent, view view, int PO 
  Sition, long id) {_id= (int) ID; New Alertdialog.builder (this). Settitle ("hint"). Setmessage ("OK to delete this detail?"). SetIcon (R.drawable.quit). Setpositivebutton ("OK", new Dialoginterface.onclicklistener () {public void OnClick (Di 
       Aloginterface dialog, int whichbutton) {//log.v ("", "" +_id); 
       Billdb.delbills (_id); 
       Madapter.changecursor (cur); 
      ((Simplecursoradapter) madapter). notifydatasetchanged (); 
     Finish (); }). Setnegativebutton ("Cancel", new Dialoginterface.onclicklistener () {public void OnClick (Dialoginterface D 
  Ialog, int whichbutton) {}}). Show (); 
 return true; } 

After so many days of study, my colabox from the input to show details of the section are basically almost done, this article to tidy up the code, the need to improve the place, the example is temporarily here.

Series of articles:

Android Personal Finance Tool Six: Show billing details below

Android Personal Finance tool five: show billing details

Android Personal Finance Tools Four: Add Bill page below

Android Personal Finance Tool Three: Add Bill page

Android Personal Finance Tools two: Use SQLite to implement initialization data at startup

Android Personal Finance Tools One: Project overview and implementation of the launch interface

That's what Android's personal finance tools are all about, and it's a good tutorial for people who start learning about Android apps!

Related Article

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.