Fix crash when exiting ot of profile page while loading

This commit is contained in:
Balazs Toldi 2023-08-19 15:35:18 +02:00
parent 116deebf87
commit bf1036c919
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
3 changed files with 3 additions and 3 deletions

View File

@ -531,7 +531,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
return true;
};
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
descriptionTextView.setOnLongClickListener(view -> {
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {

View File

@ -458,7 +458,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
return true;
};
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
descriptionTextView.setOnLongClickListener(view -> {
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {

View File

@ -59,7 +59,7 @@ public class MarkdownUtils {
}
@NonNull
public static Markwon createDescriptionMarkwon(Context context, MarkwonPlugin miscPlugin,
public static Markwon createDescriptionMarkwon(Application context, MarkwonPlugin miscPlugin,
BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
return Markwon.builder(context)
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {