In demo, if I click back button to quit, then it won't work next time #31

Closed
hcjcch opened this Issue Oct 19, 2015 · 4 comments

Comments

2 participants
@hcjcch

hcjcch commented Oct 19, 2015

I think private static ConnectivityStatus status = ConnectivityStatus.UNKNOWN; should be changed to private ConnectivityStatus status = ConnectivityStatus.UNKNOWN;

@pwittchen

This comment has been minimized.

Show comment
Hide comment
@pwittchen

pwittchen Oct 19, 2015

Owner

Can you explain, what do you mean by "won't work"? Application crashed or it wasn't reacting on connectivity changes? Do you have any LogCat output, which can help to find source of the potential problem?

In ReactiveNetwork class, status attribute is static, because I wanted to have a single instance of ConnectivityStatus, which could be used to verify if status changed or not after receiving an event in BroadcastReceiver. The reason of that is the fact that I encountered situations in which status was emitted two times when single event occurred.

Owner

pwittchen commented Oct 19, 2015

Can you explain, what do you mean by "won't work"? Application crashed or it wasn't reacting on connectivity changes? Do you have any LogCat output, which can help to find source of the potential problem?

In ReactiveNetwork class, status attribute is static, because I wanted to have a single instance of ConnectivityStatus, which could be used to verify if status changed or not after receiving an event in BroadcastReceiver. The reason of that is the fact that I encountered situations in which status was emitted two times when single event occurred.

@pwittchen pwittchen changed the title from In demo ,if click back button to quit,then no work in the next time to In demo, if I click back button to quit, then it doesn't work next time Oct 19, 2015

@pwittchen pwittchen changed the title from In demo, if I click back button to quit, then it doesn't work next time to In demo, if I click back button to quit, then it won't work next time Oct 19, 2015

@hcjcch

This comment has been minimized.

Show comment
Hide comment
@hcjcch

hcjcch Oct 20, 2015

if (newStatus != status) {
  status = newStatus;
  subscriber.onNext(newStatus);
}

The status is static ,if you quit the application(not kill),the statuswill keep the last time the value.If your network status not change,newStatus != status will false ,and tvConnectivityStatuswill always show Waiting for connectivity status until your network status be changed.

hcjcch commented Oct 20, 2015

if (newStatus != status) {
  status = newStatus;
  subscriber.onNext(newStatus);
}

The status is static ,if you quit the application(not kill),the statuswill keep the last time the value.If your network status not change,newStatus != status will false ,and tvConnectivityStatuswill always show Waiting for connectivity status until your network status be changed.

@pwittchen

This comment has been minimized.

Show comment
Hide comment
@pwittchen

pwittchen Oct 20, 2015

Owner

Thank you. This explanation is quite clear. I'll try to reproduce it. If your suggestion is right, it may be quick fix.

Owner

pwittchen commented Oct 20, 2015

Thank you. This explanation is quite clear. I'll try to reproduce it. If your suggestion is right, it may be quick fix.

@pwittchen pwittchen self-assigned this Oct 20, 2015

@pwittchen pwittchen added the bug label Oct 20, 2015

@pwittchen

This comment has been minimized.

Show comment
Hide comment
@pwittchen

pwittchen Nov 2, 2015

Owner

I was able to reproduce this bug. It's fixed in f34a53c. I'm sorry that you had to wait so long for such simple change. Fortunately, I found a moment to take a look at this issue.

This fix will be available in the next release.

Owner

pwittchen commented Nov 2, 2015

I was able to reproduce this bug. It's fixed in f34a53c. I'm sorry that you had to wait so long for such simple change. Fortunately, I found a moment to take a look at this issue.

This fix will be available in the next release.

@pwittchen pwittchen closed this Nov 2, 2015

@pwittchen pwittchen referenced this issue Nov 2, 2015

Closed

Release v. 0.1.3 #33

6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment