fix Glide crash in MainActivity (#1379)
* fix Glide crash in MainActivity * make emojiInitCallback final
This commit is contained in:
parent
75734d0e91
commit
bcd5262314
|
@ -120,6 +120,13 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||||
private int notificationTabPosition;
|
private int notificationTabPosition;
|
||||||
private MainPagerAdapter adapter;
|
private MainPagerAdapter adapter;
|
||||||
|
|
||||||
|
private final EmojiCompat.InitCallback emojiInitCallback = new EmojiCompat.InitCallback() {
|
||||||
|
@Override
|
||||||
|
public void onInitialized() {
|
||||||
|
updateProfiles();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -309,6 +316,12 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
EmojiCompat.get().unregisterInitCallback(emojiInitCallback);
|
||||||
|
}
|
||||||
|
|
||||||
private void forwardShare(Intent intent) {
|
private void forwardShare(Intent intent) {
|
||||||
Intent composeIntent = new Intent(this, ComposeActivity.class);
|
Intent composeIntent = new Intent(this, ComposeActivity.class);
|
||||||
composeIntent.setAction(intent.getAction());
|
composeIntent.setAction(intent.getAction());
|
||||||
|
@ -438,12 +451,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
|
||||||
drawer.addItem(debugItem);
|
drawer.addItem(debugItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
EmojiCompat.get().registerInitCallback(new EmojiCompat.InitCallback() {
|
EmojiCompat.get().registerInitCallback(emojiInitCallback);
|
||||||
@Override
|
|
||||||
public void onInitialized() {
|
|
||||||
updateProfiles();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupTabs(boolean selectNotificationTab) {
|
private void setupTabs(boolean selectNotificationTab) {
|
||||||
|
|
Loading…
Reference in New Issue