NFC - missing method getParcelableExtra( ... )

by Lars Nielsen Lind » Tue, 15 Mar 2011 06:21:10 GMT

Sponsored Links

I have used the following code which is published on various sites:

PendingIntent intent =
PendingIntent.getActivity(this.getApplicationContext(), 0,new
Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),0);

null, null);

Tag tag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

Here is the error message:

The method getParcelableExtra(String) is undefined for the type

Anyone that knows why I can't call getParcelable(....) as shown above?




Re: NFC - missing method getParcelableExtra( ... )

by Mark Murphy » Tue, 15 Mar 2011 06:24:51 GMT

 You can call getParcelableExtra() on an Intent, not on a PendingIntent.

On Mon, Mar 14, 2011 at 6:21 PM, Lars Nielsen Lind

Mark Murphy (a Commons Guy)  |  | 

Android Training in Oslo: 


Sponsored Links

Other Threads

1. ListView data binding from XML (REST-RPC request)


I currently building an adnroid apps that retrive data from a distant
Web service and i search an efficient way to bind data form XML to
I already use CursorAdapter and i search on the web for an
"XmlAdapter". I read on Google IO topic "Coding for Life -- Battery
Life, That Is" (
CodingLifeBatteryLife.html) that is more efficient to use "stream
parser" instead of "tree parser" but i don't find the way to build a
class that implement ListAdapter because of stream parser can't
navigate backward so i don't understand how implement method that use
"position" parameter (How retrive data before curent XML Parser
position ???).

I don't find solution for this problem on the web after make search
(maybe a don't make good search), so could you give me the way to
solve my problem ?



2. HTC Hero has multi-touch. SDK support?

Doesn't apple have a multitouch patent?


3. Drawing in a child View

4. Vertical and Horizontal Scrolling together

5. Open Market

6. Gempa Mentawai

7. Telit GSM Module & Dialer