我通过意图在twitter分享中遇到问题.
我通过意图打开了一个Twitter应用程序,一旦我点击登录按钮强行关闭.我无法找到错误报告.
Twitter严格是android中的默认共享吗?或者需要使用他们的SDK.
这是我默认推特分享的代码.大家好,让我知道......
尝试
{
Intent shareIntent = ShareCompat.IntentBuilder
.from(Activity.this).setType("text/plain")
.setText("Shopup" + review).getIntent()
.setPackage("com.twitter.android");
startActivity(shareIntent);
} catch (Exception e)
{
// TODO: handle exception
Toast.makeText(Activity.this, "Need twitter application",
Toast.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud) 我想阻止聊天列表中的某位朋友XMPP.代码工作正常.没有例外,但我无法阻止用户.我正在使用开火服务器.我应该在服务器上做些什么改变?
你们有什么想法吗?
我的代码:
public void XMPPAddNewPrivacyList(Connection connection, String userName) {
String listName = "newList";
// Create the list of PrivacyItem that will allow or
// deny some privacy aspect
List<PrivacyItem> privacyItems = new Vector<PrivacyItem>();
PrivacyItem item = new PrivacyItem(PrivacyItem.Type.jid.toString(),
false, 1);
item.setValue(userName);
privacyItems.add(item);
// Create the new list.
try {
PrivacyListManager privacyManager = new PrivacyListManager(connection);
privacyManager = PrivacyListManager
.getInstanceFor(connection);
privacyManager.createPrivacyList(listName, privacyItems);
} catch (XMPPException e) {
System.out.println("PRIVACY_ERROR: " + e);
}
}
Run Code Online (Sandbox Code Playgroud)