Error starting NFC Tagwriter intent

bluedude

Well-Known Member
Licensed User
Longtime User
What am I doing wrong here?

Sub writeTag (URL As String)

Dim i As Intent
i.Initialize(i.ACTION_SEND,URL)
i.SetComponent ("com.nxp.nfc.tagwriter")
StartActivity(i)

End Sub
 

bluedude

Well-Known Member
Licensed User
Longtime User
Default intent

As far as I know that will only give me the default intent from that package and not sure if that is the writing mode. I want to make sure that startactivity always starts the NFC writing intent from Tagwriter.

I haven't been able to create a piece of code to get me all intents/activities from a package.

Cheers,
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Found the activity

Hi,

I found a way to list all activities and it is called WriterActivity.

When listing the acitivities it gives me :

com.nxp.nfc.tagwriter.activities.WriterActivity

However when I run this with below code it gives me an AcvitityNotFoundException while the same piece of code works with YouTube videos (of course with another activity name). I also tried tagwriter.activities/.WriterActivity but no luck.

Is below call correct parameter wise?

Sub writeTag (URL As String)

Dim i As Intent
i.Initialize(i.ACTION_VIEW,URL)
i.SetComponent ("com.nxp.nfc.tagwriter/.WriterActivity")
i.PutExtra ("",URL)
StartActivity(i)

End Sub
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Inconsistent

Do you know why all this stuff is so inconsistent? The youtube component works different :)
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Starts but then quits

That works and it starts the activity but then it quits (not a force close) and goes back to my app.

Arghhh..
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Non standard?

So if this is non-standard why does it work when I use the i.WrapAsIntentChooser?

Below works with Tagwriter and puts it in writing mode.

Sub shareContent (shareText As String,shareType As String )

Dim i As Intent
i.Initialize(i.ACTION_SEND, "")
i.SetType("text/plain")
i.PutExtra("android.intent.extra.TEXT", shareText)
'translate
i.WrapAsIntentChooser("Share with")
StartActivity(i)

End Sub
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Is there a way to filter just on an app with i.WrapAsIntentChooser("Share with") ?

That would solve my problem too. Because there is no NFC writer library I need to use external apps.
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Nope, also because I need to write an URL that I initiate from a listview.

So why does the WrapAsIntentChooser works fine?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Bugger, that means I cannot solve the problem. Wondering if it is possible to catch what IntentChooser uses as an activity/intent.

Need to put my NFC product on hold if this cannot be solved, it is all about the user experience.
 
Upvote 0

Hodi

Member
Licensed User
Longtime User
write NFC Tag directly

Hi Erel, Hi bluedude,


Has everybody found a solution for this problem? I want to start the write function of the Tagwriter directly from my app but I works only by using the Choose variante.

BR
Hodi
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Guys,

Any progress with this one? Would be nice to be able to integrate into my app...

Regards,

Jon
 
Upvote 0
Top