lexicon2008 / android-smspopup

Automatically exported from code.google.com/p/android-smspopup
0 stars 0 forks source link

Multiple texts in small time interval - shows double popups #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Receive two or more texts within small time interval (less than 10-15 
seconds apart?)
2.
3.

What is the expected output? What do you see instead?
Expected: See one popup view for each new message.
Observed: One view for the first, two for the second.

What version of the product are you using? On what operating system?
v1.1.0 on CyanogenMod 7.0.2, OG Droid

Please provide any additional information below.
The app I'm running is actually a slightly redesigned one I built from source 
here, but without modifying any of the sms-receiver code or how that is handled.

I know that it isn't multiple of the same text coming in because my inbox shows 
just one copy of the multiplied popups.

Possible fix?: Implement some change in the message receiver handling code to 
check between the actual number of new messages and how many we're trying to 
build into the popup. Because I think what's happening is that the popup gets 
send the second message twice, once with the first message when it's just 
arrived and again when it gets caught by the receiver.

Original issue reported on code.google.com by mikewads...@gmail.com on 24 Jun 2011 at 3:41

GoogleCodeExporter commented 9 years ago
Fixed. (seemingly)

controls/SmsPopupSwipeView.java:58 [addMessages]

change

  public void addMessages(ArrayList<SmsMmsMessage> newMessages) {
    if (newMessages != null) {
      for (int i=0; i<newMessages.size(); i++) {
        addView(new SmsPopupView(context, newMessages.get(i)));
      }
      messages.addAll(newMessages);
      UpdateMessageCount();
    }
  }

to 

  public void addMessages(ArrayList<SmsMmsMessage> newMessages) {
    if (newMessages != null) {
      for (int i=0; i<newMessages.size(); i++) {
          // If our list of messages contains this message, skip adding it
          if (!messages.contains(newMessages.get(i))) {
//              addView(new SmsPopupView(context, newMessages.get(i)));
//              messages.add(newMessages.get(i));
              // we already have a function to do this...
              addMessage(newMessages.get(i));
          }
          else {
              Log.v("Trying to add a message already in messages...");
          }
      }
//      messages.addAll(newMessages);
//      UpdateMessageCount();
    }
  }

I have yet to see the issue arise again after this change.

Just a tip.

Original comment by mikewads...@gmail.com on 27 Jul 2011 at 8:44

GoogleCodeExporter commented 9 years ago
A fully revamped version of SMS Popup is now available in the Google Play 
Store: 
https://play.google.com/store/apps/details?id=net.everythingandroid.smspopup

I am closing out all old issues/bugs that relate to SMS Popup <=1.10 as so much 
was changed in this version. Please create new issues if you see them in the 
latest update.

Original comment by adam.eve...@gmail.com on 14 Apr 2012 at 7:37