use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by crdroidandroid.
the class BluetoothSettings method setOffMessage.
private void setOffMessage() {
final TextView emptyView = getEmptyTextView();
if (emptyView == null) {
return;
}
final CharSequence briefText = getText(R.string.bluetooth_empty_list_bluetooth_off);
final ContentResolver resolver = getActivity().getContentResolver();
final boolean bleScanningMode = Settings.Global.getInt(resolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
if (!bleScanningMode) {
// Show only the brief text if the scanning mode has been turned off.
emptyView.setText(briefText, TextView.BufferType.SPANNABLE);
} else {
final StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append(briefText);
contentBuilder.append("\n\n");
contentBuilder.append(getText(R.string.ble_scan_notify_text));
LinkifyUtils.linkify(emptyView, contentBuilder, new LinkifyUtils.OnClickListener() {
@Override
public void onClick() {
final SettingsActivity activity = (SettingsActivity) BluetoothSettings.this.getActivity();
activity.startPreferencePanel(BluetoothSettings.this, ScanningSettings.class.getName(), null, R.string.location_scanning_screen_title, null, null, 0);
}
});
}
setTextSpan(emptyView.getText(), briefText);
}
use of com.android.settings.SettingsActivity in project android_packages_apps_Settings by crdroidandroid.
the class BluetoothSettings method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
mDeviceNamePrefController = new BluetoothDeviceNamePreferenceController(context, lifecycle);
mPairingPrefController = new BluetoothPairingPreferenceController(context, this, (SettingsActivity) getActivity());
controllers.add(mDeviceNamePrefController);
controllers.add(mPairingPrefController);
controllers.add(new BluetoothFilesPreferenceController(context));
controllers.add(new BluetoothDeviceRenamePreferenceController(context, this, lifecycle));
return controllers;
}
use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.
the class RunningProcessesView method startServiceDetailsActivity.
// utility method used to start sub activity
private void startServiceDetailsActivity(RunningState.MergedItem mi) {
if (mOwner != null && mi != null) {
// start new fragment to display extended information
Bundle args = new Bundle();
if (mi.mProcess != null) {
args.putInt(RunningServiceDetails.KEY_UID, mi.mProcess.mUid);
args.putString(RunningServiceDetails.KEY_PROCESS, mi.mProcess.mProcessName);
}
args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
SettingsActivity sa = (SettingsActivity) mOwner.getActivity();
sa.startPreferencePanel(mOwner, RunningServiceDetails.class.getName(), args, R.string.runningservicedetails_settings_title, null, null, 0);
}
}
use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.
the class InstalledAppDetails method startAppInfoFragment.
public static void startAppInfoFragment(Class<?> fragment, CharSequence title, SettingsPreferenceFragment caller, AppEntry appEntry) {
// start new fragment to display extended information
Bundle args = new Bundle();
args.putString(ARG_PACKAGE_NAME, appEntry.info.packageName);
args.putInt(ARG_PACKAGE_UID, appEntry.info.uid);
SettingsActivity sa = (SettingsActivity) caller.getActivity();
sa.startPreferencePanel(caller, fragment.getName(), args, -1, title, caller, SUB_INFO_FRAGMENT);
}
use of com.android.settings.SettingsActivity in project platform_packages_apps_Settings by BlissRoms.
the class AppOpsDetails method setIntentAndFinish.
private void setIntentAndFinish(boolean finish, boolean appChanged) {
Intent intent = new Intent();
intent.putExtra(ManageApplications.APP_CHG, appChanged);
SettingsActivity sa = (SettingsActivity) getActivity();
sa.finishPreferencePanel(this, Activity.RESULT_OK, intent);
}
Aggregations