我想在我的Android代码中获取手机上的社交媒体客户列表。我不明白为什么,但我在List的初始化时得到了一个nullpounterexception 我需要清单中的权限才能执行此操作吗?我所拥有的就是这种方法,并且可以通过它来调用它。
public Intent findSocialMediaClients() {
final String subject;
final String body;
subject = "Great Event to tell you about";
body = "test";
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("text/plain");
List<ResolveInfo> tempActivities = context.getPackageManager().queryIntentActivities(sendIntent, 0); // error here!
List<ResolveInfo> activities = new ArrayList<ResolveInfo>(); ....