use of android.os.Bundle in project android by cSploit.
the class WifiScannerFragment method onBackPressed.
public void onBackPressed() {
mScanReceiver.unregister();
mConnectionReceiver.unregister();
Bundle bundle = new Bundle();
bundle.putBoolean(CONNECTED, mConnected);
Intent intent = new Intent();
intent.putExtras(bundle);
getActivity().setResult(AppCompatActivity.RESULT_OK, intent);
getActivity().finish();
getActivity().overridePendingTransition(R.anim.fadeout, R.anim.fadein);
}
use of android.os.Bundle in project android-betterpickers by code-troopers.
the class ExpirationPickerDialogFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
if (args != null && args.containsKey(REFERENCE_KEY)) {
mReference = args.getInt(REFERENCE_KEY);
}
if (args != null && args.containsKey(THEME_RES_ID_KEY)) {
mTheme = args.getInt(THEME_RES_ID_KEY);
}
if (args != null && args.containsKey(MONTH_KEY)) {
mMonthOfYear = args.getInt(MONTH_KEY);
}
if (args != null && args.containsKey(YEAR_KEY)) {
mYear = args.getInt(YEAR_KEY);
}
if (args != null && args.containsKey(MINIMUM_YEAR_KEY)) {
mMinimumYear = args.getInt(MINIMUM_YEAR_KEY);
}
setStyle(DialogFragment.STYLE_NO_TITLE, 0);
// Init defaults
mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
mDialogBackgroundResId = R.drawable.dialog_full_holo_dark;
if (mTheme != -1) {
TypedArray a = getActivity().getApplicationContext().obtainStyledAttributes(mTheme, R.styleable.BetterPickersDialogFragment);
mTextColor = a.getColorStateList(R.styleable.BetterPickersDialogFragment_bpTextColor);
mDialogBackgroundResId = a.getResourceId(R.styleable.BetterPickersDialogFragment_bpDialogBackground, mDialogBackgroundResId);
}
}
use of android.os.Bundle in project android-betterpickers by code-troopers.
the class HmsPickerDialogFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
if (args != null && args.containsKey(REFERENCE_KEY)) {
mReference = args.getInt(REFERENCE_KEY);
}
if (args != null && args.containsKey(THEME_RES_ID_KEY)) {
mTheme = args.getInt(THEME_RES_ID_KEY);
}
if (args != null && args.containsKey(PLUS_MINUS_VISIBILITY_KEY)) {
mPlusMinusVisibility = args.getInt(PLUS_MINUS_VISIBILITY_KEY);
}
setStyle(DialogFragment.STYLE_NO_TITLE, 0);
// Init defaults
mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
mDialogBackgroundResId = R.drawable.dialog_full_holo_dark;
if (mTheme != -1) {
TypedArray a = getActivity().getApplicationContext().obtainStyledAttributes(mTheme, R.styleable.BetterPickersDialogFragment);
mTextColor = a.getColorStateList(R.styleable.BetterPickersDialogFragment_bpTextColor);
mDialogBackgroundResId = a.getResourceId(R.styleable.BetterPickersDialogFragment_bpDialogBackground, mDialogBackgroundResId);
}
}
use of android.os.Bundle in project android-betterpickers by code-troopers.
the class NumberPickerDialogFragment method newInstance.
/**
* Create an instance of the Picker (used internally)
*
* @param reference an (optional) user-defined reference, helpful when tracking multiple Pickers
* @param themeResId the style resource ID for theming
* @param minNumber (optional) the minimum possible number
* @param maxNumber (optional) the maximum possible number
* @param plusMinusVisibility (optional) View.VISIBLE, View.INVISIBLE, or View.GONE
* @param decimalVisibility (optional) View.VISIBLE, View.INVISIBLE, or View.GONE
* @param labelText (optional) text to add as a label
* @return a Picker!
*/
public static NumberPickerDialogFragment newInstance(int reference, int themeResId, BigDecimal minNumber, BigDecimal maxNumber, Integer plusMinusVisibility, Integer decimalVisibility, String labelText, Integer currentNumberValue, Double currentDecimalValue, Integer currentNumberSign) {
final NumberPickerDialogFragment frag = new NumberPickerDialogFragment();
Bundle args = new Bundle();
args.putInt(REFERENCE_KEY, reference);
args.putInt(THEME_RES_ID_KEY, themeResId);
if (minNumber != null) {
args.putSerializable(MIN_NUMBER_KEY, minNumber);
}
if (maxNumber != null) {
args.putSerializable(MAX_NUMBER_KEY, maxNumber);
}
if (plusMinusVisibility != null) {
args.putInt(PLUS_MINUS_VISIBILITY_KEY, plusMinusVisibility);
}
if (decimalVisibility != null) {
args.putInt(DECIMAL_VISIBILITY_KEY, decimalVisibility);
}
if (labelText != null) {
args.putString(LABEL_TEXT_KEY, labelText);
}
if (currentNumberValue != null) {
args.putInt(CURRENT_NUMBER_KEY, currentNumberValue);
}
if (currentDecimalValue != null) {
args.putDouble(CURRENT_DECIMAL_KEY, currentDecimalValue);
}
if (currentNumberSign != null) {
args.putInt(CURRENT_SIGN_KEY, currentNumberSign);
}
frag.setArguments(args);
return frag;
}
use of android.os.Bundle in project kickmaterial by byoutline.
the class ProjectsListFragment method newInstance.
public static ProjectsListFragment newInstance(@Nullable Category category) {
ProjectsListFragment instance = new ProjectsListFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_CATEGORY, Parcels.wrap(category));
instance.setArguments(args);
return instance;
}
Aggregations