我怎样才能改变我的Andr​​oid中的Gtalk和Gmail中的地位? [英] How can i change the status of my Gtalk or Gmail in Android?

查看:167
本文介绍了我怎样才能改变我的Andr​​oid中的Gtalk和Gmail中的地位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用我的应用程序,我想改变我的Gmail或者Gtalk的状态。我怎样才能改变呢? 有什么样code ??

Using my application, i want to change the status of my gmail or gtalk. How can i change it? Is there any sample code??

在此先感谢。

推荐答案

如果您正在使用的啪API 为Android:

If you are using Smack API for Android :

// 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);

这篇关于我怎样才能改变我的Andr​​oid中的Gtalk和Gmail中的地位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆