Share Android micro-letter Red Envelope plugin _android

Source: Internet
Author: User

This example for you to share the Android micro-letter Red envelopes for your reference, the specific content as follows

Effect Chart:

Specific code

@TargetApi (build.version_codes. Jelly_bean) private void Handlewindowchange (Accessibilitynodeinfo nodeinfo) {switch (Stage.getinstance ().
 
    Getcurrentstage ()) {case Stage.opening_stage://debug Info, print TTL//LOG.D ("TTL", String.valueof (TTL));
 
    * * If the red envelopes fail and have not reached the maximum number of attempts, retry */if (Openhongbao (nodeinfo) = = 1 && ttl < MAX_TTL) return;
    TTL = 0;
    Stage.getinstance (). Entering (stage.fetched_stage);
    Performmyglobalaction (Global_action_back);
    if (nodestofetch.size () = = 0) handlewindowchange (nodeinfo);
   Break
    Case Stage.OPENED_STAGE:ListsuccessNodes = Nodeinfo.findaccessibilitynodeinfosbytext ("Red envelope details");
     if (Successnodes.isempty () && ttl < Max_ttl) {ttl + 1;
    Return
    TTL = 0;
    Stage.getinstance (). Entering (stage.fetched_stage);
    Performmyglobalaction (Global_action_back);
   Break Case Stage.fetched_stage:/* First to eliminate the red envelopes in the queue of red envelopes/if (nodestofetch.size () > 0) {/* from the bottom of the red envelopes start poking/* AccessiBilitynodeinfo node = nodestofetch.remove (Nodestofetch.size ()-1);
 
      if (node.getparent ()!= null) {String id = gethongbaohash (node);
 
      if (id = = null) return;
 
      Fetchedidentifiers.add (ID);
 
      debugging information, after each open red envelope print out the acquired red envelopes//LOG.D ("fetched", Arrays.tostring (Fetchedidentifiers.toarray ()));
      Stage.getinstance (). Entering (stage.opening_stage);
     Node.getparent (). Performaction (Accessibilitynodeinfo.action_click);
    } return;
    } stage.getinstance (). Entering (stage.fetching_stage);
    Fetchhongbao (NodeInfo);
    Stage.getinstance (). Entering (stage.fetched_stage);
  Break }
 }

Plugin download: "Share the Android micro-letter Red envelopes"

This article has been organized into the "Android micro-credit Development tutorial Summary," Welcome to learn to read.

I hope this article will help you realize the function of micro-credit red envelopes, and help you learn more about Android software programming.

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.