Activity.getstartingintent problem

paragkini

Member
Licensed User
Longtime User
Hi,
I am designing an application which will take text inputs from other applications (mostly from browsers) and store them as links. I hv been able to get my application listed in android share list but i hv few probs:
1. Intent received has data but i am not able to read them as per the tags.
2. It gives the text completely and not as per tags.
3. App started by other app is ok but even if i start application, it expects intent. How can i chk if app is started by user or other app and if by app, whats d starting app name?

I hv attached the code using export as zip method.

(tried attaching zip from tapatalk but doesnt hv dat option. Will try to attach from web.)

Sent from my GT-N7000 using Tapatalk 2
 

Attachments

  • QuickLinks.zip
    12.8 KB · Views: 293
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1, 2: can you give an example of the values you expect and the values that you receive?

3. You should always check the GetStartingIntent in ActivityResume and then decide what started your application.
You can store the Intent as a global variable. You will then be able to compare the current GetStartingIntent with the previous one. If they are equal you should ignore it.
 
Upvote 0

paragkini

Member
Licensed User
Longtime User
Hi Erel,
Apologies for delayed reply, was on official tour. Revert toyour points:
1. I have attached a screen shot of values that I am getting in Extras.
2. Values I expect are (in extra)
GetExtra("TEXT") should return ""http://www.google.com/m?........ "
GetExtra("SUBJECT") should return "Title of the page"

3. Pls help me to chk that starting intent. By default it is taking intent.

What my application is expected to do is:
1. If user is browsing internet with whichever browser he is using.
2. He wants to save the link of current page he is viesing in my application (app which i am trying to develop)
3. So he long presses on the address bar of the browser and selects "Share page" from the list shown
4. My application is invoked and shows a dialog box with below data in respective fields
a. Subject = Title of the webpage he is saving
b. URL = URL of the webpage he is saving
5. Later on user will go to my application and click on the icon of the URL he wants to visit
6. My application launches browser (I dont want to use web view)

Pls help. Also pls guide me to a link which helps understand and develop intent.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    42.2 KB · Views: 292
Last edited:
Upvote 0

paragkini

Member
Licensed User
Longtime User
It worked.

Thanks Erel. It was pretty simple. Working on the getstartingintent to find out which application started my application. Facing issues though. But will revert if none of my efforts help.
 
Upvote 0
Top