- Home /
Is there any Native share code for Tizen Mobile App Build?
I have a native share feature in my app. When i converted it to Tizen. Its not working and made me frustated. Try to find any solution but cant find anything that related. Is there somebody that successfully convert the code?
string path = System.IO.Path.Combine(Application.persistentDataPath, "Screenshot.png");
Application.CaptureScreenshot("Screenshot.png");
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", "file://" + path);
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_STREAM"), uriObject);
intentObject.Call<AndroidJavaObject>("setType", "image/jpeg");
AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
// option one WITHOUT chooser:
currentActivity.Call("startActivity", intentObject);
Comment
Your answer
Follow this Question
Related Questions
Android Native share (intent) an image with a link 4 Answers
Need help ios native share 1 Answer
Share screen and text on social media 1 Answer
Tizen build fails with error : build.info file does not exist 0 Answers
I need to set the path for saving the pictures with an application for Android and IOS 2 Answers