Home android Is it possible to make my activity which will be started first...

Is it possible to make my activity which will be started first and take Intent data?

Author

Date

Category

Hello I want to know whether it is possible to make my activity be launched first and could also take some data from another application. But when I do, as shown below in my manifest, the applications disappears from the application list and is only when sending data:

& lt; activey
    Android: Name = ". MainActivity"
    Android: Configchanges = "Orientation | Screensize | KeyboardHidden"
    Android: label = "add" & gt;
    & lt; INTENT-FILTER & GT;
      & lt; Action Android: name = "Android.Intent.action.send" / & gt;
      & lt; Category Android: Name = "Android.intent.category.default" / & gt;
      & lt; Data Android: MimeType = "Text / Plain" / & gt;
      & lt; Action Android: name = "Android.Intent.action.Main" / & gt;
      & lt; Category Android: Name = "Android.intent.category.launcher" / & gt;
    & lt; / Intent-Filter & GT;
  & lt; / activity & gt;

If you can do this how? Thank you in advance.
P.S. I can foresee an alternative: “Make another starting activity which at the entrance will immediately move to the activity you need and with FINISH () Complete the operation of starting activity” It does not fit me.


Answer 1, Authority 100%

  1. No, you can not do, according to anyone if there are several applications that support text files in the system (Text / Plain ), then when you first start, the user will be presented a list of applications from which User will choose himself.

  2. you need to plant each action for separate intent-filter , like:

& lt; intent-filter & gt;
      & lt; Action Android: name = "Android.Intent.action.send" / & gt;
      & lt; Category Android: Name = "Android.intent.category.default" / & gt;
      & lt; Data Android: MimeType = "Text / Plain" / & gt;
    & lt; / Intent-Filter & GT;
    & lt; INTENT-FILTER & GT;
      & lt; Action Android: name = "Android.Intent.action.Main" / & gt;
      & lt; Category Android: Name = "Android.intent.category.launcher" / & gt;
    & lt; / Intent-Filter & GT;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions