การแชร์ข้อมูลอย่างง่าย
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สิ่งหนึ่งที่ยอดเยี่ยมเกี่ยวกับแอป Android คือความสามารถในการสื่อสารและผสานรวมกัน เหตุใดจึงต้องสร้างฟังก์ชันการทำงานที่ไม่ได้เป็นแกนหลักของแอปพลิเคชันขึ้นมาใหม่ในเมื่อมีอยู่แล้วในแอปพลิเคชันอื่น
ส่วนนี้จะกล่าวถึงวิธีทั่วไปบางวิธีในการส่งและรับข้อมูลแบบง่าย (เช่น ข้อความ รูปภาพ และไฟล์) ระหว่างแอปพลิเคชันโดยใช้ชีตการแชร์ของ Android และ Intent Resolver ด้วยออบเจ็กต์ Intent
บทเรียน
- การส่งข้อมูลอย่างง่ายไปยังแอปอื่นๆ
- ดูวิธีตั้งค่าแอปพลิเคชันเพื่อให้สามารถส่งข้อความและข้อมูลอื่นๆ ไปยังแอปพลิเคชันอื่นๆ ด้วย Sharesheet ของ Android และเครื่องมือแก้ไข Intent
- การรับข้อมูลอย่างง่ายจากแอปอื่นๆ
- ดูวิธีตั้งค่าแอปพลิเคชันเพื่อรับข้อความและข้อมูลอื่นๆ จาก Intent
หมายเหตุ: ไม่แนะนําอย่างยิ่งให้ใช้ ActionProvider
เพื่อแสดงการดําเนินการแชร์ภายในแอปพลิเคชัน
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Sharing simple data\n\nOne of the great things about Android apps is their ability to communicate and\nintegrate with each other. Why reinvent functionality that isn't core to your application when it\nalready exists in another application?\n\nThis section covers some common ways you can send and receive simple data (like text, images and files) between\napplications using the Android Sharesheet and Intent Resolver with\n[Intent](/reference/android/content/Intent) objects.\n\nLessons\n-------\n\n**[Sending Simple Data to Other Apps](/training/sharing/send)**\n: Learn how to set up your application to be able to send text and other data to other\n applications with the Android Sharesheet and intent resolver.\n\n**[Receiving Simple Data from Other Apps](/training/sharing/receive)**\n: Learn how to set up your application to receive text and other data from intents.\n\nNote: use of [ActionProvider](/reference/android/view/ActionProvider)\nto show share actions within your application is highly discouraged."]]