Skip to content

Commit d5dc646

Browse files
committed
some fix
1 parent 2b630d5 commit d5dc646

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ The Mqtt Android Service is an MQTT client library for developing applications o
99
**Step 1.** Add it in your root **build.gradle** at the end of repositories:
1010

1111
```groovy
12-
allprojects {
13-
repositories {
14-
...
15-
maven { url 'https://jitpack.io' }
16-
}
17-
}
12+
allprojects {
13+
repositories {
14+
...
15+
maven { url 'https://jitpack.io' }
16+
}
17+
}
1818
```
1919

2020
**Step 2.** Add the dependency:
2121

2222
```groovy
2323
dependencies {
24-
implementation 'com.github.shiyinghan:MqttAndroid:1.0.0'
25-
}
24+
implementation 'com.github.shiyinghan:MqttAndroid:1.0.0'
25+
}
2626
```
2727

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
<activity
2424
android:name=".module.activity.ConnectionListActivity"
25-
android:launchMode="singleTask">
25+
android:launchMode="singleTask"
26+
android:screenOrientation="portrait">
2627
<intent-filter>
2728
<action android:name="android.intent.action.MAIN" />
2829

@@ -31,9 +32,11 @@
3132
</activity>
3233
<activity
3334
android:name=".module.activity.ConnectionEditActivity"
35+
android:screenOrientation="portrait"
3436
android:windowSoftInputMode="stateHidden|adjustResize" />
3537
<activity
3638
android:name=".module.activity.ConnectionPortalActivity"
39+
android:screenOrientation="portrait"
3740
android:windowSoftInputMode="stateHidden|adjustResize" />
3841
</application>
3942

mqtt/src/main/java/com/shiyinghan/mqtt/android/service/MqttAndroidClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
16491649
synchronized void notifyOffline() {
16501650
traceDebug(TAG, "Offline with client:" + getClientId() + '/' + getServerURI());
16511651

1652-
if (callback != null && !connectOptions.isCleanSession()) {
1652+
if (isConnected() && callback != null && !connectOptions.isCleanSession()) {
16531653
Exception e = new Exception("Android offline");
16541654
callback.connectionLost(e);
16551655
}

0 commit comments

Comments
 (0)