Results:
1. The sharing of text is not so, the reason is unclear. The great God knows, please m, thank you very much here.
2. If you want to support picture editing, change the editable of the action event to true.
Related information:
Website address: Http://docwiki.embarcadero.com/RADStudio/XE7/en/Mobile_Tutorial:_Taking_and_Sharing_a_Picture,_and_ Sharing_text_ (ios_and_android)
Instance code:
1 UnitUnit1;2 3 Interface4 5 uses6 system.sysutils, System.types, System.uitypes, system.classes, System.variants,7 FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, Fmx.stdctrls,8 FMX. Controls.presentation, System.actions, FMX. Actnlist, FMX. Objects,9 FMX. Stdactns, FMX. Medialibrary.actions, FMX. Scrollbox, FMX. Memo;Ten One type ATForm1 =class(Tform) - Toolbar1:ttoolbar; - Button1:tbutton; the Button2:tbutton; - Button3:tbutton; - Image1:timage; - actionlist1:tactionlist; + takephotofromcameraaction1:ttakephotofromcameraaction; - takephotofromlibraryaction1:ttakephotofromlibraryaction; + showsharesheetaction1:tshowsharesheetaction; A Button4:tbutton; at Memo1:tmemo; - showsharesheetaction2:tshowsharesheetaction; - proceduretakephotofromcameraaction1didfinishtaking (image:tbitmap); - proceduretakephotofromlibraryaction1didfinishtaking (image:tbitmap); - procedureShowsharesheetaction1beforeexecute (sender:tobject); - procedureShowsharesheetaction2beforeexecute (sender:tobject); in Private - {Private Declarations} to Public + {Public Declarations} - End; the * var $ Form1:tform1;Panax Notoginseng - Implementation the + {$R *.FMX} A {$R *. NMXHDPIPH.FMX ANDROID} the + //Share Pictures - procedureTform1.showsharesheetaction1beforeexecute (sender:tobject); $ begin $ ShowShareSheetAction1.Bitmap.Assign (image1.bitmap); - End; - the //Share Text - procedureTform1.showsharesheetaction2beforeexecute (sender:tobject);Wuyi begin theshowsharesheetaction1.textmessage:=Memo1.Lines.Text; - End; Wu - //Call Camera About proceduretform1.takephotofromcameraaction1didfinishtaking (image:tbitmap); $ begin - Image1.Bitmap.Assign (Image); - End; - A //using the picture library + proceduretform1.takephotofromlibraryaction1didfinishtaking (image:tbitmap); the begin - Image1.Bitmap.Assign (Image); $ End; the the End.
Android instances-take and share photos, share text (xe8+ Xiaomi 2)