change share for open in

This commit is contained in:
Page Asgardius 2022-09-08 18:13:41 -07:00
parent cfb171d488
commit 1f98f23e11
3 changed files with 6 additions and 7 deletions

View file

@ -8,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
@ -257,7 +258,7 @@ public class ObjectSelect extends AppCompatActivity {
public boolean onMenuItemClick(MenuItem menuItem) {
// Toast message on menu item clicked
//Toast.makeText(MainActivity.this, "You Clicked " + menuItem.getTitle(), Toast.LENGTH_SHORT).show();
if (menuItem.getTitle() == getResources().getString(R.string.file_share)) {
if (menuItem.getTitle() == getResources().getString(R.string.file_external)) {
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString());
URL objectURL = s3client.generatePresignedUrl(request);
share(objectURL.toString());
@ -324,10 +325,8 @@ public class ObjectSelect extends AppCompatActivity {
try {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Share Link");
shareIntent.putExtra(Intent.EXTRA_TEXT, object);
Intent shareIntent = new Intent(Intent.ACTION_VIEW);
shareIntent.setData(Uri.parse(object));
startActivity(Intent.createChooser(shareIntent, "choose one"));
} catch(Exception e) {
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();

View file

@ -3,7 +3,7 @@
<item
android:id="@+id/sharefile"
android:title="@string/file_share" />
android:title="@string/file_external" />
<item
android:id="@+id/deletefile"

View file

@ -4,7 +4,7 @@
<string name="title_activity_video_player">VideoPlayer</string>
<string name="broken_database">Local database is corrupted. Please reinstall this app</string>
<string name="pending_feature">This feature is not implemented yet</string>
<string name="file_share">Get link</string>
<string name="file_external">Open in</string>
<string name="file_del">Delete</string>
<string name="accountselect">Please choose an account</string>
<string name="accountadd_button">Add Account</string>