private void Update(int currentVersion, int lastestVersion) { dialog = new UpdateDialog( mContext, Integer.toString(currentVersion), Integer.toString(lastestVersion), new UpdateDialog.UpdateActionListener() { @Override public void onSend(final UpdateDialog dialog, Boolean updateble) { if (updateble) { List<NameValuePair> mAdditionalParams = new ArrayList<NameValuePair>(); mAdditionalParams.add( new BasicNameValuePair( "requesttask", Integer.toString(NexxooWebservice.WEBTASK_GETUPDATE))); NexxooWebservice.performUpdate( mContext, mAdditionalParams, getCallback(mContext, false)); TextView tv_update_title = (TextView) dialog.findViewById(R.id.tv_update_title); tv_update_title.setText("Bitte warten...."); mProgressSpinner = (ProgressBar) dialog.findViewById(R.id.update_spinner); mProgressSpinner.setIndeterminate(true); mProgressSpinner.setVisibility(View.VISIBLE); /** set update button not clickable while downloading the apk file */ Button upt_button = (Button) dialog.findViewById(R.id.btn_update); upt_button.setClickable(false); } else { Calendar currentTime = Calendar.getInstance(); long seconds = currentTime.getTimeInMillis(); // long nextTime = seconds +24*60*60; long nextTime = seconds + 24 * 60 * 60 * 1000; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); SharedPreferences.Editor editor = prefs.edit(); editor.putLong( mContext.getString(R.string.radiothek_bundle_next_update_time), nextTime); editor.commit(); dialog.dismiss(); } } }); dialog.show(); }