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.