更新时间:2023-01-01 17:35:45
以下意图过滤器添加到您的活动宣言,在项目的AndroidManifest:
Add the following intent-filters to your activity declaration, in the AndroidManifest of your project :
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
现在,在的onCreate() onResume()或 onNewIntent()您的活动周期的方法,你可以使用的getData()在意向STRONG> 已经解雇了您的活动。
Now, in the onCreate(), onResume() or onNewIntent() method of your activity lifecycle, you can use the getData() of the intent that has fired your activity.