我这样做:
toolbar = (Toolbar) findViewById(com.sports.unity.R.id.tool_bar);
setSupportActionBar(toolbar);
setTitle("hello");
Run Code Online (Sandbox Code Playgroud)
我想在标题"hello"中为文本设置自定义字体.怎么做?
我在android中使用Facebook sdk 4.4.0,我希望使用图形请求获取用户的当前个人资料图片.怎么做?
我见过人们用
https://graph.facebook.com/me/picture?access_token=ACCESS_TOKEN
用于提取个人资料图片的API,但我无法想象如何从中提取个人资料图片.
即时通讯使用服务来保持我的xmpp连接始终处于活动状态是代码:
public class XMPPService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
new ConnectionStatus().execute();
return START_STICKY;
}
@Override
public void onCreate() {
Log.i("service", "created");
}
public class ConnectionStatus extends AsyncTask{
@Override
protected Object doInBackground(Object[] params) {
XMPPClient.getConnection().addConnectionListener(
new AbstractConnectionListener() {
public void connectionClosed() {
Log.i("connection", "closed");
}
public void connectionClosedOnError(Exception e) {
Log.i("connection", "closed on error");
}
public void reconnectionFailed(Exception e) {
Log.i("reconnection", "failed");
}
public void reconnectionSuccessful() {
if (XMPPClient.getConnection().isAuthenticated()) {
Log.i("isauthenticauted : ", …Run Code Online (Sandbox Code Playgroud)