Reputation: 3956
I coded an intent to start twitter app but it's throwing ActivityNotFoundException
even when I have the layest version of twitter installed.
My Code
Intent twitShare = new Intent()
.setType("text/plain")
.setPackage("com.twitter.android")
.setData(Uri.parse(url))
.setAction(Intent.ACTION_SEND);
startActivity(twitShare);
Please , what am I doing wrong?
Upvotes: 1
Views: 108
Reputation: 1007554
Remove setData()
from your Intent
. ACTION_SEND
does not use the data facet of the Uri
. Follow the instructions in the ACTION_SEND
documentation to supply your data to send, either via EXTRA_TEXT
or EXTRA_STREAM
.
Upvotes: 1