Skip to content

Commit

Permalink
Use application context in SmackAndroid
Browse files Browse the repository at this point in the history
Prevents "IllegalArgumentException: Receiver not registered:
org.jivesoftware.smack.SmackAndroid$ConnectivtyChangedReceiver"

Fixes #100.
  • Loading branch information
Flowdalic committed May 30, 2014
1 parent 62fa239 commit c1363cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static-src/custom/org/jivesoftware/smack/SmackAndroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public void onReceive(Context context, Intent intent) {
private Context mCtx;

private SmackAndroid(Context ctx) {
mCtx = ctx;
// Use the application context to prevent "receiver not registered" messages
mCtx = ctx.getApplicationContext();
DNSUtil.setDNSResolver(DNSJavaResolver.getInstance());
}

Expand Down

0 comments on commit c1363cb

Please sign in to comment.