android - 如何在 Android 中更改我的 Gtalk 或 Gmail 的状态?

标签 android

使用我的应用程序,我想更改我的 gmail 或 gtalk 的状态。我该如何改变它? 有没有示例代码??

提前致谢。

最佳答案

如果您使用 Smack API对于安卓:

// Create the presence object with default availability 
Presence presence = new Presence(Presence.Type.available);

// Set the status message
presence.setStatus("Lame status is lame");

// Set the highest priority
presence.setPriority(24);

// Set available presence mode
presence.setMode(Presence.Mode.available);

// Send the presence packet through the connection
connection.sendPacket(presence);

关于android - 如何在 Android 中更改我的 Gtalk 或 Gmail 的状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3243827/

相关文章:

java - 多行文本。 libgdx

Android Studio Gradle 错误 - preDexDebug

Android比较UTF-8字符串与UTF-8输入字符串的edittext

java - 使用适用于 Android 的 Parse 和 Java 从 JSON 创建对象

android - 查找蓝牙设备的类型,无论是移动设备、笔记本电脑还是 Mac 电脑

android - 无法连接到 localhost/127.0.0.1 android

android - 在 Trusted Web Activity 中地址栏不隐藏

android - 布局 :weight on Button change Android

android - Kotlin 中的 Firebase firestore 权限被拒绝

Java Android - Redmi 3 (MIUI) - 无法更改通知图标?