fix pendingintent in chrome custom tab not updating

remove unnecessary extra_subject from share intents
This commit is contained in:
Andrew Dolgov 2015-12-01 23:02:03 +03:00
parent 1c2ae86a35
commit d4f355fc79
6 changed files with 6 additions and 11 deletions

View File

@ -403,8 +403,7 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
if (url != null) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_SUBJECT, url);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, url);
startActivity(Intent.createChooser(intent, url));

View File

@ -55,6 +55,8 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc
public static final int EXCERPT_MAX_LENGTH = 256;
public static final int EXCERPT_MAX_QUERY_LENGTH = 2048;
public static final int PENDING_INTENT_CHROME_SHARE = 1;
private DatabaseHelper m_databaseHelper;
//private SQLiteDatabase m_readableDb;
@ -255,10 +257,10 @@ public class CommonActivity extends ActionBarActivity implements SharedPreferenc
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, uri.toString());
shareIntent.putExtra(Intent.EXTRA_TEXT, uri.toString());
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, shareIntent, 0);
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),
CommonActivity.PENDING_INTENT_CHROME_SHARE, shareIntent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setActionButton(BitmapFactory.decodeResource(getResources(), R.drawable.ic_share),
getString(R.string.share_article), pendingIntent);

View File

@ -549,7 +549,6 @@ public class OnlineActivity extends CommonActivity {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_SUBJECT, getLastContentImageHitTestUrl());
intent.putExtra(Intent.EXTRA_TEXT, getLastContentImageHitTestUrl());
startActivity(Intent.createChooser(intent, getLastContentImageHitTestUrl()));
@ -1353,7 +1352,6 @@ public class OnlineActivity extends CommonActivity {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, article.title);
intent.putExtra(Intent.EXTRA_TEXT, article.link);
return intent;

View File

@ -241,7 +241,6 @@ public class VideoPlayerActivity extends CommonActivity {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, m_streamUri);
intent.putExtra(Intent.EXTRA_TEXT, m_streamUri);
startActivity(Intent.createChooser(intent, m_streamUri));

View File

@ -115,7 +115,6 @@ public class YoutubePlayerActivity extends CommonActivity implements YouTubePlay
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, m_streamUri);
intent.putExtra(Intent.EXTRA_TEXT, m_streamUri);
startActivity(Intent.createChooser(intent, m_streamUri));

View File

@ -99,8 +99,7 @@ public class OfflineActivity extends CommonActivity {
if (getLastContentImageHitTestUrl() != null) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_SUBJECT, getLastContentImageHitTestUrl());
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, getLastContentImageHitTestUrl());
startActivity(Intent.createChooser(intent, getLastContentImageHitTestUrl()));
@ -670,7 +669,6 @@ public class OfflineActivity extends CommonActivity {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, title);
intent.putExtra(Intent.EXTRA_TEXT, link);
return intent;