我想像这个应用程序一样分享文本
我怎样才能做到这一点?
最佳答案
有两个步骤:
- 从独立于平台的 Libgdx 应用代码获取平台(Android 代码)
- 启动 Android Share 意图
如果您希望平台无关的 Libgdx 代码能够调用 Android 特定的库,通常需要在平台无关位和平台特定位之间创建一个小型接口(interface)或桥梁。请参阅https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code
进入平台代码后,您需要调用正确的 Android Intent API。您没有提供有关您尝试共享哪种数据的任何详细信息(这可能会更改您要使用的 API),但请参阅 http://developer.android.com/training/sharing/send.html
关于libGDX android - 共享文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22635925/