Below is the code of my Activity . In this I am using the support library appcompat
import android.content.Intent;
import android.os.Bundle;
import
If this line
shareAction.setShareIntent(shareIntent);
is throwing a NullPointerException
, this sentence
(ShareActionProvider) MenuItemCompat.getActionProvider(item);
must be returning null
.
Have a look at the post below, which talks about reasons why this would happen.
NullPointerException on setShareIntent using ActionBarSherlock