ListView after clicking on the item to go to the detailed page returns the ListView data does not display the problem

Source: Internet
Author: User

Reason:

After triggering the return button to jump to the main screen of the ListView, the data to reload, at this time to load the data, it will start the activity when the program automatically loaded, and handler inside the main thread is written, will be executed, so add later

/**
* Process message (main thread), update adapter, if processing in thread may error
* */
Handler = new Handler () {

@Override
public void Handlemessage (Message msg) {
Switch (msg.what) {
Case Util.download_start:
Progressdialog.show ();
Progressdialog.setmessage (Msg.getdata (). Get ("text")
. toString ());
Toast.maketext (Checkorderactivity.this, Util.currentmessage,
Toast.length_long). Show ();
Break
Case Util.download_end:
Progressdialog.dismiss ();
Break
Case UTIL.DOWNLOAD_OK:
threadcontinue=false;//End Thread
Toast.maketext (Checkorderactivity.this, Util.currentmessage,
Toast.length_long). Show ();
Setdatatoui ();
Progressdialog.dismiss ();
Break
Case UTIL.DOWNLOAD_ERROR:
Progressdialog.dismiss ();
Toast.maketext (Checkorderactivity.this, "No billing Information", Toast.length_long)
. Show ();
Break
Case Util.download_disconnect:
Progressdialog.dismiss ();
Alertdialog.builder builder = new Builder (checkorderactivity.this);
Builder.setmessage ("Not connected on network!");
Builder.settitle ("hint");
Builder.setpositivebutton ("Confirm",
New Dialoginterface.onclicklistener () {
@Override
public void OnClick (Dialoginterface dialog,
int which) {
Dialog.dismiss ();
}
});
Builder.create (). Show ();
Break
}
Super.handlemessage (msg);//method that executes the parent class
}
};

adapter = new Myadapterr (checkorderactivity.this, FieldList);
Search ();//Request data to service
}

can be successfully resolved.

This article is from the "New Start" blog, so be sure to keep this source http://10042542.blog.51cto.com/10032542/1686204

ListView after clicking on the item to go to the detailed page returns the ListView data does not display the problem

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.