Skip to content

Instantly share code, notes, and snippets.

@soulfly
Created January 14, 2016 10:57
Show Gist options
  • Save soulfly/c81835ee236c232c229a to your computer and use it in GitHub Desktop.
Save soulfly/c81835ee236c232c229a to your computer and use it in GitHub Desktop.
// init test user
final QBUser qbUser = new QBUser();
qbUser.setId(ApplicationConfig.getInstance().getTestUserId1());
qbUser.setPassword(ApplicationConfig.getInstance().getTestUserPassword1());
log("login with user: " + qbUser);
//
//
if(!chatService.isLoggedIn()) {
class MyTask extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... params) {
try {
chatService.login(qbUser);
} catch (SmackException | IOException | XMPPException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
}
}
new MyTask().execute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment