mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
Fix file sharing to properly handle EXTRA_STREAM Parcelable
- Add support for EXTRA_STREAM as Parcelable URI instead of just String - Check for streamParcelable first, then fall back to string extras - Add logging to show both String and Parcelable EXTRA_STREAM values - This should fix the issue where file sharing was receiving description text instead of actual file content The logs showed that EXTRA_STREAM was null as String but the file content should be available as a Parcelable URI.
This commit is contained in:
@@ -715,9 +715,19 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
||||
Intent.ACTION_SEND -> {
|
||||
val streamExtra = intent.getStringExtra(Intent.EXTRA_STREAM);
|
||||
val textExtra = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
Logger.i(TAG, "Share Received - EXTRA_STREAM: $streamExtra");
|
||||
val streamParcelable = intent.getParcelableExtra<android.net.Uri>(Intent.EXTRA_STREAM);
|
||||
|
||||
Logger.i(TAG, "Share Received - EXTRA_STREAM (String): $streamExtra");
|
||||
Logger.i(TAG, "Share Received - EXTRA_STREAM (Parcelable): $streamParcelable");
|
||||
Logger.i(TAG, "Share Received - EXTRA_TEXT: $textExtra");
|
||||
targetData = streamExtra ?: textExtra;
|
||||
|
||||
// Try to get the actual file content
|
||||
targetData = when {
|
||||
streamParcelable != null -> streamParcelable.toString()
|
||||
streamExtra != null -> streamExtra
|
||||
textExtra != null -> textExtra
|
||||
else -> null
|
||||
}
|
||||
Logger.i(TAG, "Share Received - Final targetData: " + targetData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user