For Android apps, if you set AndroidManifest.xml as an int-filter, the app will be displayed in Share... of each video of the Android app on YouTube.
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/*"/>
</intent-filter>
AndroidManifest.xml is
<activity>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/*"/>
</intent-filter>
</activity>
Receive Activity (e.g. MainActivity) onCreate
Intent=getIntent();
String action=intent.getAction();
if(Intent.ACTION_SEND.equals(action)){
Bundleextras=intent.getExtras();
if(extras!=null){
CharSequence ext=extras.getCharSequence(Intent.EXTRA_TEXT);
if(ext!=null){
EditTexteditText= (EditText) findbyid (R.id.***); // Example
editText.setText(ext); // Example
}
}
}
© 2024 OneMinuteCode. All rights reserved.