Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
抱歉这个菜鸟问题,但我一直使用 ActionBarSherlock 的 ShareActionProvider。现在我根本不想使用 ActionBarSherlock - 我想使用侧边菜单并有一个共享按钮 - 我可以这样做吗?
你可以把它放在点击监听器或类似的东西中。
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); sendIntent.setType("text/plain"); startActivity(sendIntent);
应该显示这样的对话框: