mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 07:44:11 +01:00
add extras direct to intent, do not use option/bundle
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
72761ebb5f
commit
ebb878d6a5
@ -27,11 +27,8 @@ import android.content.Intent;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.LayerDrawable;
|
import android.graphics.drawable.LayerDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import autodagger.AutoInjector;
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
|
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
|
||||||
@ -45,6 +42,15 @@ import com.nextcloud.talk.utils.DrawableUtils;
|
|||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||||
import com.vanniktech.emoji.EmojiTextView;
|
import com.vanniktech.emoji.EmojiTextView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import autodagger.AutoInjector;
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
import io.reactivex.SingleObserver;
|
import io.reactivex.SingleObserver;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
@ -52,10 +58,6 @@ import io.reactivex.disposables.Disposable;
|
|||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageMessageViewHolder<ChatMessage> {
|
public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageMessageViewHolder<ChatMessage> {
|
||||||
|
|
||||||
@ -116,10 +118,9 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
|
|||||||
filesAppIntent.setComponent(componentName);
|
filesAppIntent.setComponent(componentName);
|
||||||
filesAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
filesAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
filesAppIntent.setPackage(context.getString(R.string.nc_import_accounts_from));
|
filesAppIntent.setPackage(context.getString(R.string.nc_import_accounts_from));
|
||||||
Bundle options = new Bundle();
|
filesAppIntent.putExtra(BundleKeys.KEY_ACCOUNT, accountString);
|
||||||
options.putString(BundleKeys.KEY_ACCOUNT, accountString);
|
filesAppIntent.putExtra(BundleKeys.KEY_FILE_ID, message.getSelectedIndividualHashMap().get("id"));
|
||||||
options.putString(BundleKeys.KEY_FILE_ID, message.getSelectedIndividualHashMap().get("id"));
|
context.startActivity(filesAppIntent);
|
||||||
context.startActivity(filesAppIntent, options);
|
|
||||||
} else {
|
} else {
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message.getSelectedIndividualHashMap().get("link")));
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message.getSelectedIndividualHashMap().get("link")));
|
||||||
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
Loading…
Reference in New Issue
Block a user