Skip to content

Commit 51750ff

Browse files
committed
Fixed monitor not unregistering
1 parent 8b15ea0 commit 51750ff

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="nl.techinc.notify"
44

5-
android:versionCode="8"
6-
android:versionName="2.2.2" >
5+
android:versionCode="9"
6+
android:versionName="2.3" >
77

88
<permission android:name="nl.techinc.notify.permission.C2D_MESSAGE" android:protectionLevel="signature" />
99

bin/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="nl.techinc.notify"
44

5-
android:versionCode="8"
6-
android:versionName="2.2.2" >
5+
android:versionCode="9"
6+
android:versionName="2.3" >
77

88
<permission android:name="nl.techinc.notify.permission.C2D_MESSAGE" android:protectionLevel="signature" />
99

bin/Techinc-Notify.apk

28 Bytes
Binary file not shown.

bin/classes.dex

20 Bytes
Binary file not shown.
109 Bytes
Binary file not shown.

bin/resources.ap_

2 Bytes
Binary file not shown.

src/nl/techinc/notify/NotifyActivity.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ public void run()
8181

8282
public void setMonitor()
8383
{
84+
if(!sharedPreferences.getBoolean("gcm_supported", true))
85+
return;
8486
if(!sharedPreferences.getBoolean("gcm_enabled", true))
87+
{
88+
if(GCMRegistrar.isRegistered(this))
89+
GCMRegistrar.unregister(this);
8590
return;
91+
}
8692
TextView label = (TextView) findViewById(R.id.monitoring);
8793
try
8894
{
@@ -97,10 +103,8 @@ public void setMonitor()
97103
final String regId = GCMRegistrar.getRegistrationId(this);
98104
if (regId.equals("")) {
99105
GCMRegistrar.register(this, SENDER_ID);
100-
label.setText(R.string.updating);
101-
} else {
102-
label.setText(R.string.monitoring_enabled);
103106
}
107+
label.setText(R.string.monitoring_enabled);
104108
}
105109

106110
@Override

0 commit comments

Comments
 (0)