Beispiel #1
0
 protected void onPostExecute(DefaultBean response) {
   if (response != null && response.getHttpCode().equals(AppConstants.OK)) taskCallback.done(true);
   else {
     alert.showAlertDialog(
         activity, "Attenzione!", "Si è verificato un problema. Riprovare!", false);
     taskCallback.done(false);
   }
 }
 public boolean checkNetwork() {
   cd = new ConnectionDetector(getApplicationContext());
   // Check if Internet present
   if (cd.isConnectingToInternet()) {
     return true;
   } else {
     // Internet Connection is not present
     alert.showAlertDialog(
         CreaGruppoActivity.this,
         "Connessione Internet assente",
         "Controlla la tua connessione internet!",
         null);
     // stop executing code by return
     return false;
   }
 }
Beispiel #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile);

    Bundle extras = getIntent().getExtras();
    emailProfilo = (String) extras.get("emailProfilo");
    idPartita = (Long) extras.get("idPartita");
    idGruppo = (Long) extras.get("idGruppo");

    Log.e(TAG, "emailProfilo: " + emailProfilo);

    pref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE);
    idSessione = pref.getLong("IdSessione", -1);
    email = pref.getString("EmailUtente", null);
    Log.e(TAG, "idSessione: " + idSessione);
    Log.e(TAG, "email: " + email);

    emptyText = (TextView) findViewById(android.R.id.empty);

    logoutButton = (Button) findViewById(R.id.btn_logout);
    if (!email.equals(emailProfilo)) logoutButton.setVisibility(View.GONE);
    else logoutButton.setOnClickListener(this);

    cpv = (CircularProgressView) findViewById(R.id.progress_view);

    if (idSessione == -1 || email == null)
      alert.showAlertDialog(this, "Attenzione!", "Si è verificato un problema. Riprovare!", false);

    /* VISUALIZZO ACTION BAR CON LOGO */
    getSupportActionBar().setHomeButtonEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayUseLogoEnabled(true);
    getSupportActionBar().setLogo(R.drawable.logo_small);
    getSupportActionBar().setDisplayShowTitleEnabled(true);

    // Ottenimento lista stati
    if (checkNetwork())
      new ListaStatiAT(getApplicationContext(), this, idSessione, this, email).execute();
    if (checkNetwork())
      new GetGiocatoreAT(getApplicationContext(), this, this, idSessione, emailProfilo).execute();
  }