use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ManageAccountsSettings method onSyncStateUpdated.
@Override
protected void onSyncStateUpdated() {
showSyncState();
// Catch any delayed delivery of update messages
final Activity activity = getActivity();
if (activity != null) {
activity.invalidateOptionsMenu();
}
}
use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ManageAccountsSettings method onStop.
@Override
public void onStop() {
super.onStop();
final Activity activity = getActivity();
activity.getActionBar().setDisplayOptions(0, ActionBar.DISPLAY_SHOW_CUSTOM);
activity.getActionBar().setCustomView(null);
}
use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SoundFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Activity activity = getActivity();
ContentResolver resolver = getActivity().getContentResolver();
addPreferencesFromResource(R.xml.rr_sound_settings);
mWiredHeadsetRingtoneFocus = (ListPreference) findPreference(WIRED_RINGTONE_FOCUS_MODE);
int mWiredHeadsetRingtoneFocusValue = Settings.Global.getInt(resolver, Settings.Global.WIRED_RINGTONE_FOCUS_MODE, 1);
mWiredHeadsetRingtoneFocus.setValue(Integer.toString(mWiredHeadsetRingtoneFocusValue));
mWiredHeadsetRingtoneFocus.setSummary(mWiredHeadsetRingtoneFocus.getEntry());
mWiredHeadsetRingtoneFocus.setOnPreferenceChangeListener(this);
mLaunchPlayerHeadsetConnection = (ListPreference) findPreference(HEADSET_CONNECT_PLAYER);
int mLaunchPlayerHeadsetConnectionValue = Settings.System.getIntForUser(resolver, Settings.System.HEADSET_CONNECT_PLAYER, 0, UserHandle.USER_CURRENT);
mLaunchPlayerHeadsetConnection.setValue(Integer.toString(mLaunchPlayerHeadsetConnectionValue));
mLaunchPlayerHeadsetConnection.setSummary(mLaunchPlayerHeadsetConnection.getEntry());
mLaunchPlayerHeadsetConnection.setOnPreferenceChangeListener(this);
}
use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WriteWifiConfigToNfcDialog method onClick.
@Override
public void onClick(View v) {
mWakeLock.acquire();
String password = mPasswordView.getText().toString();
String wpsNfcConfigurationToken = mWifiManager.getWpsNfcConfigurationToken(mNetworkId);
String passwordHex = byteArrayToHexString(password.getBytes());
String passwordLength = password.length() >= HEX_RADIX ? Integer.toString(password.length(), HEX_RADIX) : "0" + Character.forDigit(password.length(), HEX_RADIX);
passwordHex = String.format(PASSWORD_FORMAT, passwordLength, passwordHex).toUpperCase();
if (wpsNfcConfigurationToken.contains(passwordHex)) {
mWpsNfcConfigurationToken = wpsNfcConfigurationToken;
Activity activity = getOwnerActivity();
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(activity);
nfcAdapter.enableReaderMode(activity, new NfcAdapter.ReaderCallback() {
@Override
public void onTagDiscovered(Tag tag) {
handleWriteNfcEvent(tag);
}
}, NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_NFC_B | NfcAdapter.FLAG_READER_NFC_BARCODE | NfcAdapter.FLAG_READER_NFC_F | NfcAdapter.FLAG_READER_NFC_V, null);
mPasswordView.setVisibility(View.GONE);
mPasswordCheckBox.setVisibility(View.GONE);
mSubmitButton.setVisibility(View.GONE);
InputMethodManager imm = (InputMethodManager) getOwnerActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mPasswordView.getWindowToken(), 0);
mLabelView.setText(R.string.status_awaiting_tap);
mView.findViewById(R.id.password_layout).setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
mProgressBar.setVisibility(View.VISIBLE);
} else {
mLabelView.setText(R.string.status_invalid_password);
}
}
use of android.app.Activity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CryptKeeperSettings method addEncryptionInfoToPreference.
private void addEncryptionInfoToPreference(Preference preference, int type, String password) {
Activity activity = getActivity();
DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE);
if (dpm.getDoNotAskCredentialsOnBoot()) {
preference.getExtras().putInt(TYPE, StorageManager.CRYPT_TYPE_DEFAULT);
preference.getExtras().putString(PASSWORD, "");
} else {
preference.getExtras().putInt(TYPE, type);
preference.getExtras().putString(PASSWORD, password);
}
}
Aggregations