Search in sources :

Example 91 with Activity

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();
    }
}
Also used : SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity)

Example 92 with Activity

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);
}
Also used : SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity)

Example 93 with Activity

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);
}
Also used : Activity(android.app.Activity) ContentResolver(android.content.ContentResolver)

Example 94 with Activity

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);
    }
}
Also used : Activity(android.app.Activity) NfcAdapter(android.nfc.NfcAdapter) InputMethodManager(android.view.inputmethod.InputMethodManager) Tag(android.nfc.Tag)

Example 95 with Activity

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);
    }
}
Also used : DevicePolicyManager(android.app.admin.DevicePolicyManager) Activity(android.app.Activity)

Aggregations

Activity (android.app.Activity)3220 Intent (android.content.Intent)612 View (android.view.View)535 Test (org.junit.Test)456 TextView (android.widget.TextView)263 Context (android.content.Context)220 ArrayList (java.util.ArrayList)201 Bundle (android.os.Bundle)197 DialogInterface (android.content.DialogInterface)167 SettingsActivity (com.android.settings.SettingsActivity)167 ViewGroup (android.view.ViewGroup)133 ImageView (android.widget.ImageView)116 AlertDialog (android.app.AlertDialog)109 LayoutInflater (android.view.LayoutInflater)109 Preference (android.support.v7.preference.Preference)83 PackageManager (android.content.pm.PackageManager)76 Uri (android.net.Uri)76 EditText (android.widget.EditText)72 ComponentName (android.content.ComponentName)71 Handler (android.os.Handler)71