Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by val-creare · Nov 09, 2018 at 09:09 PM · androidjavamanifestsendintent

How to handle an intent from another Android App in Unity?

I have an Android app, in which I send a message via a Intent.Action_SEND filter. I've tried many things but I always get the error: No Activity found to handle Intent. What am I doing wrong?

Android app code, proven to work on another Android app:

     Intent sendIntent = new Intent();
     sendIntent.setAction(Intent.ACTION_SEND);
     sendIntent.setPackage(appName);
     sendIntent.putExtra("TABSINT_DATA_JSON_STRING", data);
     sendIntent.setType("text/plain");
     sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
     activityContext.startActivity(sendIntent);



I created a Receiver.java script in Unity to handle the intent:

 package com.company.pkg;

 import ...;

 public class Receiver extends Activity {

   @Override
   protected void onNewIntent(Intent intent) {
       super.onNewIntent(intent);
       String action = intent.getAction();
       Log.d(TAG,"Java Receiver intent action: "+action);
   }
 }



I added the .Receiver activity in my AndroidManifest.xml
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity> <activity android:name="com.company.pkg.Receiver" android:label="@string/Receiver" android:parentActivityName="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain"/> </intent-filter> </activity> ... </application> ...



@Antique @Zyosoft @Onizuka101 @angusmf

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image knmanas6 · Sep 14, 2020 at 06:23 AM 0
Share

hi man! I'm stuck with the same problem tried a lot of options like making a separate plugin and also making a C# script still couldn't solve it let me know if you have got it. cheers!!

avatar image val-creare · Sep 14, 2020 at 12:49 PM 0
Share

$$anonymous$$y problem was in the Android$$anonymous$$anifest. I had to put the manifest in the correct folder (Assets/Plugins/Android) for Unity to merge it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hexagonius · Nov 09, 2018 at 09:39 PM

is this something for you? the answer is von Zyosoft:
https://answers.unity.com/questions/1327186/how-to-get-intent-data-for-unity-to-use.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image val-creare · Nov 12, 2018 at 03:47 PM 0
Share

Thank you for your answer @hexagonius. I am trying to get the intent in java ins$$anonymous$$d of in C# to have more flexibility on the Native layer, so the answer you refer to is not quite it. There are other answers on the web using that strategy.

$$anonymous$$y problem was in the Android$$anonymous$$anifest. I fixed it: I had to put the manifest in the correct folder (Assets/Plugins/Android) for Unity to merge it. Thanks anyways!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

214 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to extend UnityPlayerActivity 0 Answers

Read NFC tag from Unity3d android 1 Answer

How to send multiple screenshots to the android intent(Social networks - Mail, WhatsApp, Hangouts, Facebook ...etc) 2 Answers

UnityPlayerActivity vs. UnityPlayerNativeActivity 0 Answers

How to make your Android app open xml or custom files? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges