mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
* fixed:After canceling a sharing, application goes back to the search menu #2296 * fixed:After canceling a sharing, application goes back to the search menu #2296 * fixed:After canceling a sharing, application goes back to the search menu #2296 * fixed SeachActivityUnityTest failure when calling testOnBackPressed and cleaned up unnecessary code
This commit is contained in:
parent
7d895c4379
commit
94d462cafb
3 changed files with 26 additions and 4 deletions
|
|
@ -188,6 +188,18 @@ public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment imple
|
|||
shareIntent.setType("text/plain");
|
||||
shareIntent.putExtra(Intent.EXTRA_TEXT, m.getDisplayTitle() + " \n" + m.getPageTitle().getCanonicalUri());
|
||||
startActivity(Intent.createChooser(shareIntent, "Share image via..."));
|
||||
|
||||
//Add media detail to backstack when the share button is clicked
|
||||
//So that when the share is cancelled or completed the media detail page is on top
|
||||
// of back stack fixing:https://github.com/commons-app/apps-android-commons/issues/2296
|
||||
FragmentManager supportFragmentManager = getActivity().getSupportFragmentManager();
|
||||
if (supportFragmentManager.getBackStackEntryCount() < 2) {
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.addToBackStack(MediaDetailPagerFragment.class.getName())
|
||||
.commit();
|
||||
supportFragmentManager.executePendingTransactions();
|
||||
}
|
||||
return true;
|
||||
case R.id.menu_browser_current_image:
|
||||
// View in browser
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue