ShareLinkContent code
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentUrl(Uri.parse(shareUrl))
.setContentTitle(shareTitle)
.build();
Share Dialog codes that I tried
a. Using Share Dialog object
ShareDialog dialog = new ShareDialog(this);
dialog.show(content, ShareDialog.Mode.AUTOMATIC); //tried other 4 modes too
b. Using static access
ShareDialog.show(this, content);
Now the issue is, it works perfectly well in all the regular phones like Motorola, Samsung, Pixel, Lenovo.
But same code is causing weird behaviour in Redmi devices. When I click the button that invokes this code, keyboard and Share dialog appears, stays there for few milliseconds and then disappear.
Am i supposed to anything special to handle Facebook dialogs in MI devices?
There is an option of creating custom dialog box, but I want to keep it as the last option.
Edit
Same is happening with Facebook Like button too.
Here is the code for Facebook like button
facebookLikeView.setObjectIdAndType("https://www.facebook.com/StartupScribble/", LikeView.ObjectType.PAGE);
This code too works perfectly in most of the devices except Redmi devices.