Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
add wait dialog while bots are added #430
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Feb 13, 2018
1 parent 2601e94 commit f0d82cf
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.awesomeapp.messenger.ui;

import android.app.ProgressDialog;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -84,11 +85,22 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public void onBotClicked(final String jid, final String nickname) {
ImApp app = (ImApp)getApplication();

final ProgressDialog dialog;
dialog = new ProgressDialog(this);
dialog.setMessage(getString(R.string.upgrade_progress_action));
dialog.setCancelable(true);
dialog.show();

new AddContactAsyncTask(app.getDefaultProviderId(), app.getDefaultAccountId(), app){
@Override
protected void onPostExecute(Integer response) {
super.onPostExecute(response);

if (dialog.isShowing()) {
dialog.dismiss();
}

Intent intent = new Intent(ServicesActivity.this, MainActivity.class);
intent.putExtra("username", jid);
startActivity(intent);
Expand Down

0 comments on commit f0d82cf

Please sign in to comment.