Search in sources :

Example 26 with Bundle

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);
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 27 with Bundle

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);
    }
}
Also used : Bundle(android.os.Bundle) TypedArray(android.content.res.TypedArray)

Example 28 with Bundle

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);
    }
}
Also used : Bundle(android.os.Bundle) TypedArray(android.content.res.TypedArray)

Example 29 with Bundle

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;
}
Also used : Bundle(android.os.Bundle)

Example 30 with Bundle

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;
}
Also used : Bundle(android.os.Bundle)

Aggregations

Bundle (android.os.Bundle)6155 Intent (android.content.Intent)826 RemoteException (android.os.RemoteException)477 View (android.view.View)342 Test (org.junit.Test)266 ArrayList (java.util.ArrayList)216 TextView (android.widget.TextView)203 PersistableBundle (android.os.PersistableBundle)201 PendingIntent (android.app.PendingIntent)185 IOException (java.io.IOException)176 Uri (android.net.Uri)155 ImageView (android.widget.ImageView)152 ComponentName (android.content.ComponentName)124 Fragment (android.support.v4.app.Fragment)124 Message (android.os.Message)122 JSONObject (org.json.JSONObject)112 Account (android.accounts.Account)108 Context (android.content.Context)102 Parcelable (android.os.Parcelable)99 Bitmap (android.graphics.Bitmap)90