Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Fixed issue where app crashes when opening a permalink on Android 6 in React Native #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
import java.util.Date;
import java.util.List;

import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;


abstract class AbstractTweetView extends RelativeLayout{
static final String TAG = TweetUi.LOGTAG;
Expand Down Expand Up @@ -246,6 +248,7 @@ private void setPermalinkLauncher() {

void launchPermalink() {
final Intent intent = new Intent(Intent.ACTION_VIEW, getPermalinkUri());
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
if (!IntentUtils.safeStartActivity(getContext(), intent)) {
Twitter.getLogger().e(TweetUi.LOGTAG, "Activity cannot be found to open permalink URI");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void onClick(Context context, Resources resources) {
final Intent shareIntent = getShareIntent(shareSubject, shareContent);
final String shareText = resources.getString(R.string.tw__share_tweet);
final Intent chooser = Intent.createChooser(shareIntent, shareText);
chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchShareIntent(chooser, context);
}

Expand Down