mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 22:45:18 +01:00
Fixed broken photo viewer after main activity destroy
This commit is contained in:
parent
fa1734518d
commit
780ca63d8d
3 changed files with 18 additions and 1 deletions
|
@ -83,7 +83,7 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 8
|
minSdkVersion 8
|
||||||
targetSdkVersion 19
|
targetSdkVersion 19
|
||||||
versionCode 274
|
versionCode 275
|
||||||
versionName "1.6.0"
|
versionName "1.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -500,6 +500,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
PhotoViewer.getInstance().destroyPhotoViewer();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
onFinish();
|
onFinish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1697,6 +1697,22 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroyPhotoViewer() {
|
||||||
|
if (parentActivity == null || windowView == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
WindowManager wm = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
if (windowView.getParent() != null) {
|
||||||
|
wm.removeViewImmediate(windowView);
|
||||||
|
}
|
||||||
|
windowView = null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e("tmessages", e);
|
||||||
|
}
|
||||||
|
Instance = null;
|
||||||
|
}
|
||||||
|
|
||||||
private void onPhotoClosed(PlaceProviderObject object) {
|
private void onPhotoClosed(PlaceProviderObject object) {
|
||||||
disableShowCheck = true;
|
disableShowCheck = true;
|
||||||
currentMessageObject = null;
|
currentMessageObject = null;
|
||||||
|
|
Loading…
Reference in a new issue