PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 12, 2022

[FIXED] How to delete delayed messages before they arrive at a Handler?

 July 12, 2022     android, handler, messages     No comments   

Issue

My Problem is that I need to send messages with a delay of 1 second. The handler then initiates some action, you're getting the picture.

There are nevertheless some conditions in which the already sent message should be deleted ( before the second elapsed ) to prevent the handler from doing anything. I couldn't figure out how to do this ( or if it's even possible ), so If anyone of you has a clue, please let me know..


Solution

There is nothing scary about the removeMessages() methods; they are perfectly safe. The framework relies heavily on these methods and they are used in many many places, especially in the default widgets (View, ListView, etc.) It's much much better than building a Handler that ignores specific messages. This is programming, don't go with your feelings :p



Answered By - Romain Guy
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing