Fix issue with sharing urls

Closes #139
This commit is contained in:
Balazs Toldi 2023-08-18 21:26:12 +02:00
parent d216fc4640
commit d5092f50f6
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
2 changed files with 2 additions and 2 deletions

View File

@ -1219,7 +1219,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
Intent shareIntent = new Intent(Intent.ACTION_SEND); Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain"); shareIntent.setType("text/plain");
String baseURL = mRetrofit.getBaseURL().endsWith("/") ? mRetrofit.getBaseURL() : mRetrofit.getBaseURL() + "/"; String baseURL = mRetrofit.getBaseURL().endsWith("/") ? mRetrofit.getBaseURL() : mRetrofit.getBaseURL() + "/";
shareIntent.putExtra(Intent.EXTRA_TEXT, baseURL + "/" + qualifiedName); shareIntent.putExtra(Intent.EXTRA_TEXT, baseURL + "c/" + qualifiedName);
if (shareIntent.resolveActivity(getPackageManager()) != null) { if (shareIntent.resolveActivity(getPackageManager()) != null) {
startActivity(Intent.createChooser(shareIntent, getString(R.string.share))); startActivity(Intent.createChooser(shareIntent, getString(R.string.share)));
} else { } else {

View File

@ -1255,7 +1255,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
Intent shareIntent = new Intent(Intent.ACTION_SEND); Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain"); shareIntent.setType("text/plain");
String baseURL = mRetrofit.getBaseURL().endsWith("/") ? mRetrofit.getBaseURL() : mRetrofit.getBaseURL() + "/"; String baseURL = mRetrofit.getBaseURL().endsWith("/") ? mRetrofit.getBaseURL() : mRetrofit.getBaseURL() + "/";
shareIntent.putExtra(Intent.EXTRA_TEXT, baseURL + qualifiedName); shareIntent.putExtra(Intent.EXTRA_TEXT, baseURL + "u/" + qualifiedName);
if (shareIntent.resolveActivity(getPackageManager()) != null) { if (shareIntent.resolveActivity(getPackageManager()) != null) {
startActivity(Intent.createChooser(shareIntent, getString(R.string.share))); startActivity(Intent.createChooser(shareIntent, getString(R.string.share)));
} else { } else {