mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 08:40:03 +02:00
Fix issue #1032 - Sharing videos only download them
This commit is contained in:
parent
9a8d359592
commit
8832e89539
1 changed files with 4 additions and 5 deletions
|
@ -95,7 +95,8 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
||||||
shareIntent.setType(cR.getType(uri));
|
shareIntent.setType(cR.getType(uri));
|
||||||
try {
|
try {
|
||||||
startActivity(shareIntent);
|
startActivity(shareIntent);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
|
Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
|
||||||
|
@ -164,7 +165,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
||||||
binding.mediaViewpager.setAdapter(mPagerAdapter);
|
binding.mediaViewpager.setAdapter(mPagerAdapter);
|
||||||
binding.mediaViewpager.setSaveEnabled(false);
|
binding.mediaViewpager.setSaveEnabled(false);
|
||||||
binding.mediaViewpager.setCurrentItem(mediaPosition - 1);
|
binding.mediaViewpager.setCurrentItem(mediaPosition - 1);
|
||||||
ContextCompat.registerReceiver(MediaActivity.this, onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), ContextCompat.RECEIVER_NOT_EXPORTED);
|
ContextCompat.registerReceiver(MediaActivity.this, onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), ContextCompat.RECEIVER_EXPORTED);
|
||||||
String description = attachments.get(mediaPosition - 1).description;
|
String description = attachments.get(mediaPosition - 1).description;
|
||||||
handler = new Handler();
|
handler = new Handler();
|
||||||
if (attachments.get(mediaPosition - 1).status != null) {
|
if (attachments.get(mediaPosition - 1).status != null) {
|
||||||
|
@ -463,9 +464,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {
|
public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdateProgress(int progress) {
|
public void onUpdateProgress(int progress) {
|
||||||
|
|
Loading…
Reference in a new issue