beginner question.

by Honest » Thu, 04 Dec 2008 00:59:51 GMT


Sponsored Links
 I am just learning android. I was reading API documentation. I found
the following line of code which i cannot understand so can some one
explain me what is wrong in it ?


String path = intent.getStringExtra("com.example.android.apis.Path");

Can some one tell me what this method getStringExtra() will do ? and
the String "com.example.android.apis.path") means ?



--~--~---------~--~----~------------~-------~--~----~



beginner question.

by Mark Murphy » Thu, 04 Dec 2008 01:30:37 GMT


 


Intents can be packaged with "extras", which more or less amount to a 
Map of additional bits of data. While the "extras" aren't used in 
routing Intents to applications that can handle them, they can package 
information that the recipients could use to better handle the request.

Since "extras" are keyed by Strings, the core Android team recommends 
you use a namespaced-qualified key (e.g., 
"com.example.android.apis.Path") rather than something short (e.g., 
"Path"), to make sure there aren't any collisions on naming.

In terms of what, exactly, "com.example.android.apis.Path" should hold, 
you would have to ask the author of the code where you got that sample 
from. It is up to the Intent recipient to document what extras are 
available and what they should hold if used.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 

Android Training on the Ranch! -- Mar 16-20, 2009
 http://www.bignerdranch.com/schedule.shtml 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. WSDL Webservice

Hello All,

I have a case in which i have created a web service in java.
I have .wsdl file of this web service.

Now i want to send request and get response i.e. communicate with this
web service using the .wsdl file.
I tried searching a lot but did not find any satisfactory post or code
sample to do that.
Whatever i came across is of .net i.e. .asmx file.

Any help will be great.

Its also bit urgent :( so pl if anybody here can help out or can give
bit of logic or code sample anything will do to kick start.

-- 

2. Possible to receive notification of account removal?

Hi folks,

Been doing some digging but so far it's not apparent on how I can have my
app be notified (via intent possibly?) on when an account type associated
with my app is removed from the manager. When this happens I need to perform
data cleanup for that account in a local database etc.

Any insight appreciated.

Cheers,
Stacy

-- 

3. how to change TextSwitcher's textcolor or textsize??

4. PC Suite For LG GW620 aka for All Android Phone :

5. iPhoDroid: Install Android on iPhone 2G and iPhone 3G the Easy Way !

6. Encrypt and decrypt .apk files

7. upgrade ROM aPad/iRobot 2nd generatio