Java Code Examples for android.os.Bundle

The following examples show how to use android.os.Bundle. These examples are extracted from open source projects.
Example 1
Project: AvI   File: SettingsFragment.java    License: MIT License 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Load the preferences from an XML resource
    addPreferencesFromResource(R.xml.preferences);

    Preference button = findPreference(getString(R.string.pref_log_out_button));
    button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            //just set an empty token, and that will log out the user
            AccessToken accessToken = new AccessToken();
            AccessTokenStore.storeAccessToken(getActivity(), accessToken);

            Intent intent = new Intent(getActivity(), LoginActivity.class);
            //remove all active activities, so user can't go back
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
            return true;
        }
    });
}
 
Example 2
Project: braintree-android-drop-in   File: DropInActivityUnitTest.java    License: MIT License 6 votes vote down vote up
@Test
public void onSaveInstanceState_savesDeviceData() throws NoSuchFieldException,
        IllegalAccessException {
    mActivityController.setup();
    setField(DropInActivity.class, mActivity, "mDeviceData", "device-data-string");

    Bundle bundle = new Bundle();
    mActivityController.saveInstanceState(bundle)
            .pause()
            .stop()
            .destroy();

    mActivityController = Robolectric.buildActivity(DropInUnitTestActivity.class);
    mActivity = (DropInUnitTestActivity) mActivityController.get();
    mActivityController.setup(bundle);

    assertEquals("device-data-string", getField(DropInActivity.class, mActivity, "mDeviceData"));
}
 
Example 3
Project: vk_music_android   File: BaseMusicFragment.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    currentAudioCallback = new Observable.OnPropertyChangedCallback() {
        @Override
        public void onPropertyChanged(Observable observable, int i) {
            onCurrentAudioChanged(currentAudio.get());
        }
    };
    currentAlbumArtCallback = new Observable.OnPropertyChangedCallback() {
        @Override
        public void onPropertyChanged(Observable observable, int i) {
            getActivity().runOnUiThread(() -> {
                onCurrentAlbumArtChanged(currentAlbumArt.get());
            });
        }
    };
}
 
Example 4
Project: polling-station-app   File: SplashActivity.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Creates a splash screen
 * @param savedInstanceState
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash_screen);
    thisActivity = this;

    downloadProgressText = (TextView) findViewById(R.id.download_progress_text);
    currentTask = (TextView) findViewById(R.id.progress_current_task);
    downloadProgressBar = (ProgressBar) findViewById(R.id.download_progress_bar);

    if (savedInstanceState == null) {
        try {
            blockChain = BlockChain.getInstance(getApplicationContext());
            handler = new Handler();
            initTextHandler = new Handler();
            initTextHandler.post(initTextUpdater);
            handler.post(startBlockChain);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
Example 5
Project: Augendiagnose   File: TrackingUtil.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Send timing information.
 *
 * @param category The event category.
 * @param variable The variable.
 * @param label    The label.
 * @param duration The duration.
 */
public static void sendTiming(final Category category, final String variable, final String label, final long duration) {
	getDefaultFirebaseAnalytics();

	Bundle params = new Bundle();
	params.putString("category", category.toString());
	params.putString("variable", variable);
	if (label == null) {
		params.putString("label", variable);
	}
	else {
		params.putString("label", variable + " - " + label);
	}
	params.putLong("value", duration);
	mFirebaseAnalytics.logEvent("Timing", params);
}
 
Example 6
Project: Jreader   File: CatalogueFragment.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_catalogue, container, false);
    catalogueListView = (ListView)view.findViewById(R.id.catalogue);
    catalogueListView.setOnItemClickListener(this);
    Bundle bundle = getArguments();
    if (bundle != null) {
        mArgument = bundle.getString(ARGUMENT);
    }
    bookCatalogueList = new ArrayList<>();
    bookCatalogueList = DataSupport.where("bookpath = ?", mArgument).find(BookCatalogue.class);
    CatalogueAdapter catalogueAdapter = new CatalogueAdapter(getActivity(),bookCatalogueList);
    catalogueListView.setAdapter(catalogueAdapter);
    return view;
}
 
Example 7
Project: AndroidNavigation   File: AreaPickerDialogFragment.java    License: MIT License 6 votes vote down vote up
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_area_picker, container, false);
    root.findViewById(R.id.iv_cancel).setOnClickListener(v -> {
        hideDialog();
    });
    root.findViewById(R.id.tv_finish).setOnClickListener(v -> {
        int[] items = wheelOptions.getCurrentItems();
        String text = areaUtils.getOptions1Items().get(items[0]) + "-"
                + areaUtils.getOptions2Items().get(items[0]).get(items[1]) + "-"
                + areaUtils.getOptions3Items().get(items[0]).get(items[1]).get(items[2]);
        Bundle data = new Bundle();
        data.putString(KEY_SELECTED_AREA, text);
        setResult(Activity.RESULT_OK, data);
        hideDialog();
    });

    wheelOptions = new WheelOptions<>(root, true);
    return root;
}
 
Example 8
Project: BigApp_Discuz_Android   File: SuperSettingsActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ViewUtils.inject(this);
    ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
    String[] tabs = getResources().getStringArray(R.array.super_setting);
    String uid = AppSPUtils.getUid(this);
    Fragment[] fragments = {new SuperSettingCommonFragment(), new SuperSettingUserFragment()};
    viewPager.setAdapter(new SimplePagerAdapter(getSupportFragmentManager(), tabs, fragments));




    SlidingTabLayout indicator = (SlidingTabLayout) findViewById(R.id.slidingIndicator);
    indicator.setDividerColors(0);
    indicator.setSelectedIndicatorColors(ThemeUtils.getThemeColor(this));
    indicator.setViewPager(viewPager);

    setCurr(indicator);

}
 
Example 9
Project: AdvancedMaterialDrawer   File: HeadItemFiveDontCloseOnChangeActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void init(Bundle savedInstanceState) {

    drawer = this;

    // add head Item (menu will be loaded automatically)
    this.addHeadItem(getHeadItem1());
    this.addHeadItem(getHeadItem2());
    this.addHeadItem(getHeadItem3());
    this.addHeadItem(getHeadItem4());
    this.addHeadItem(getHeadItem5());

    // load menu
    this.loadMenu(getCurrentHeadItem().getMenu());

    // load the MaterialItemSectionFragment, from the given startIndex
    this.loadStartFragmentFromMenu(getCurrentHeadItem().getMenu());
}
 
Example 10
Project: android-BasicManagedProfile   File: MainActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_real);
    if (savedInstanceState == null) {
        DevicePolicyManager manager = (DevicePolicyManager)
                getSystemService(Context.DEVICE_POLICY_SERVICE);
        if (manager.isProfileOwnerApp(getApplicationContext().getPackageName())) {
            // If the managed profile is already set up, we show the main screen.
            showMainFragment();
        } else {
            // If not, we show the set up screen.
            showSetupProfile();
        }
    }
}
 
Example 11
Project: jellyfin-androidtv   File: SearchActivity.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    boolean isSpeechEnabled = SpeechRecognizer.isRecognitionAvailable(this);

    // Determine fragment to use
    Fragment searchFragment = isSpeechEnabled
            ? new LeanbackSearchFragment()
            : new TextSearchFragment();

    // Add fragment
    getSupportFragmentManager()
            .beginTransaction()
            .replace(android.R.id.content, searchFragment)
            .commit();
}
 
Example 12
Project: letv   File: NotificationCompat.java    License: Apache License 2.0 6 votes vote down vote up
public Builder extend(Builder builder) {
    Bundle wearableBundle = new Bundle();
    if (this.mFlags != 1) {
        wearableBundle.putInt(KEY_FLAGS, this.mFlags);
    }
    if (this.mInProgressLabel != null) {
        wearableBundle.putCharSequence(KEY_IN_PROGRESS_LABEL, this.mInProgressLabel);
    }
    if (this.mConfirmLabel != null) {
        wearableBundle.putCharSequence(KEY_CONFIRM_LABEL, this.mConfirmLabel);
    }
    if (this.mCancelLabel != null) {
        wearableBundle.putCharSequence(KEY_CANCEL_LABEL, this.mCancelLabel);
    }
    builder.getExtras().putBundle(EXTRA_WEARABLE_EXTENSIONS, wearableBundle);
    return builder;
}
 
Example 13
Project: ReadMark   File: SplashActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN
            , WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_splash);
    mLoadingAnimView = (LoadingAnimView) findViewById(R.id.loading_anim_view);
    mLoadingAnimView.setOnViewAnimEndListener(new LoadingAnimView.OnViewAnimEndListener() {
        @Override
        public void onViewAnimEnd() {
            Intent intent = new Intent(SplashActivity.this, MainActivity.class);
            SplashActivity.this.startActivity(intent);
            SplashActivity.this.finish();
        }
    });
    //mLoadingAnimView.startAnim();
}
 
Example 14
Project: Cake-VPN   File: MainFragment.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    binding = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);

    View view = binding.getRoot();
    initializeAll();

    return view;
}
 
Example 15
Project: qingyang   File: WelcomeActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	final View view = View.inflate(this, R.layout.welcome_actvivity, null);
	setContentView(view);

	FrameLayout frameLayout = (FrameLayout) findViewById(R.id.welcome_frame);

	BaseApplication application = (BaseApplication) getApplication();

	if (application.isTablet()) {
		frameLayout
				.setBackgroundResource(R.drawable.wecome_tablet_background);
	} else {
		frameLayout.setBackgroundResource(R.drawable.wecome_background);
	}

	// 渐变启动 从x透明度到x透明度渐变启动
	AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
	// 持续时间
	alphaAnimation.setDuration(2000);

	alphaAnimation.setAnimationListener(new MyAnimationListener());

	view.setAnimation(alphaAnimation);

}
 
Example 16
Project: Chimee   File: MainActivity.java    License: MIT License 5 votes vote down vote up
private void onOpenFileResult(int resultCode, Intent data) {
    if (resultCode != RESULT_OK) return;
    Bundle extras = data.getExtras();
    if (extras == null) return;
    String fileName = extras.getString(OpenActivity.FILE_NAME_KEY);
    String fileText = extras.getString(OpenActivity.FILE_TEXT_KEY);
    if (TextUtils.isEmpty(fileName) || fileText == null) return;
    MongolEditText editText = inputWindow.getEditText();
    editText.setText(fileText);
    editText.setSelection(0);
    inputWindow.recordSavedContent();
}
 
Example 17
Project: trekarta   File: CrashReport.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    FloatingActionButton floatingButton = mFragmentHolder.enableActionButton();
    floatingButton.setImageDrawable(getContext().getDrawable(R.drawable.ic_send));
    floatingButton.setOnClickListener(v -> {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
        File file = MapTrek.getApplication().getExceptionLog();
        intent.putExtra(Intent.EXTRA_STREAM, ExportProvider.getUriForFile(getContext(), file));
        intent.setType("vnd.android.cursor.dir/email");
        intent.putExtra(Intent.EXTRA_SUBJECT, "MapTrek crash report");
        StringBuilder text = new StringBuilder();
        text.append("Device : ").append(Build.DEVICE);
        text.append("\nBrand : ").append(Build.BRAND);
        text.append("\nModel : ").append(Build.MODEL);
        text.append("\nProduct : ").append(Build.PRODUCT);
        text.append("\nLocale : ").append(Locale.getDefault().toString());
        text.append("\nBuild : ").append(Build.DISPLAY);
        text.append("\nVersion : ").append(Build.VERSION.RELEASE);
        try {
            PackageInfo info = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
            if (info != null) {
                text.append("\nApk Version : ").append(info.versionCode).append(" ").append(info.versionName);
            }
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        intent.putExtra(Intent.EXTRA_TEXT, text.toString());
        startActivity(Intent.createChooser(intent, getString(R.string.send_crash_report)));
        mFragmentHolder.disableActionButton();
        mFragmentHolder.popCurrent();
    });
}
 
Example 18
Project: Android-Pull-To-Refresh   File: DefaultRefreshViewFragment.java    License: Apache License 2.0 5 votes vote down vote up
public static DefaultRefreshViewFragment newInstance(int mode, String title) {
    DefaultRefreshViewFragment fragment = new DefaultRefreshViewFragment();
    Bundle args = new Bundle();
    args.putInt(MODE, mode);
    args.putString(TITLE, title);
    fragment.setArguments(args);
    return fragment;
}
 
Example 19
Project: white-label-event-app   File: HomeFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    final Activity activity = getActivity();
    if (activity instanceof ContentHost) {
        host = (ContentHost) activity;
        host.setTitle(title);
    }

    final View root = getView();
    if (root == null) {
        throw new IllegalStateException();
    }

    vgMutex = (MutexViewGroup) root.findViewById(R.id.vg_mutex);

    final View content = root.findViewById(R.id.vg_content);
    vBeforeEvent = content.findViewById(R.id.v_before_event);
    vBeforeEvent.setVisibility(View.GONE);
    vAfterEvent = content.findViewById(R.id.v_after_event);
    vAfterEvent.setVisibility(View.GONE);
    cardHappeningNow = (CardView) content.findViewById(R.id.card_happening_now);
    cardHappeningNow.setVisibility(View.GONE);
    cardHappeningNow.setOnClickListener(new HappeningNowOnClickListener());
    cardUpNext = (CardView) content.findViewById(R.id.card_up_next);
    cardUpNext.setVisibility(View.GONE);
    cardUpNext.setOnClickListener(new UpNextOnClickListener());
    tvDescription = (TextView) content.findViewById(R.id.tv_description);

    updateUi();
}
 
Example 20
Project: Roid-Library   File: RLActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    displayRotation = getWindowManager().getDefaultDisplay().getRotation();

    String enableCrashHandler = RLSysUtil.getApplicationMetaData(this, "ENABLE_CRASH_HANDLER");
    if (enableCrashHandler != null && enableCrashHandler.equals("false")) {
        isEnableCrashHandler = false;
    }
    String enableAnalytics = RLSysUtil.getApplicationMetaData(this, "ENABLE_ANALYTICS");
    if (enableAnalytics != null && enableAnalytics.equals("true")) {
        isEnableAnalytics = true;
    }
    String enableFeedback = RLSysUtil.getApplicationMetaData(this, "ENABLE_FEEDBACK");
    if (enableFeedback != null && enableFeedback.equals("true")) {
        isEnableFeedback = true;
    }

    if (isEnableCrashHandler) {
        RLCrashHandler.getInstance().init(this);
    }
    if (isEnableAnalytics) {
        RLAnalyticsHelper.init(this, BuildConfig.DEBUG);
    }
    if (isEnableFeedback) {
        RLFeedbackHelper.init(this, BuildConfig.DEBUG);
    }

    if (getApplication() instanceof RLApplication) {
        ((RLApplication) getApplication()).setDisplayInfo(RLSysUtil.getDisplayInfo(this));
    }
}
 
Example 21
Project: TuentiTV   File: SearchFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  rowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
  setSearchResultProvider(this);
  setOnItemClickedListener(getDefaultItemClickedListener());
  delayedLoad = new SearchRunnable();
}
 
Example 22
Project: AOSP-Kayboard-7.1.2   File: PreferencesSettingsFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(final Bundle icicle) {
    super.onCreate(icicle);
    addPreferencesFromResource(R.xml.prefs_screen_preferences);

    final Resources res = getResources();
    final Context context = getActivity();

    // When we are called from the Settings application but we are not already running, some
    // singleton and utility classes may not have been initialized.  We have to call
    // initialization method of these classes here. See {@link LatinIME#onCreate()}.
    RichInputMethodManager.init(context);

    final boolean showVoiceKeyOption = res.getBoolean(
            R.bool.config_enable_show_voice_key_option);
    if (!showVoiceKeyOption) {
        removePreference(Settings.PREF_VOICE_INPUT_KEY);
    }
    if (!AudioAndHapticFeedbackManager.getInstance().hasVibrator()) {
        removePreference(Settings.PREF_VIBRATE_ON);
    }
    if (!Settings.readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) {
        removePreference(Settings.PREF_POPUP_ON);
    }

    refreshEnablingsOfKeypressSoundAndVibrationSettings();
}
 
Example 23
Project: recyclerview-playground   File: NumberPickerDialog.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    setButton(BUTTON_NEGATIVE, getContext().getString(android.R.string.cancel), this);
    setButton(BUTTON_POSITIVE, getContext().getString(android.R.string.ok), this);
    setView(mPicker);

    //Install contents
    super.onCreate(savedInstanceState);
}
 
Example 24
Project: UltimateAndroid   File: ImageProcessingVideotoImageActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    view = new FastImageProcessingView(this);
    pipeline = new FastImageProcessingPipeline();
    video = new VideoResourceInput(view, this, R.raw.image_processing_birds);
    edgeDetect = new SobelEdgeDetectionFilter();
    image = new JPGFileEndpoint(this, false, Environment.getExternalStorageDirectory().getAbsolutePath() + "/Pictures/outputImage", false);
    screen = new ScreenEndpoint(pipeline);
    video.addTarget(edgeDetect);
    edgeDetect.addTarget(image);
    edgeDetect.addTarget(screen);
    pipeline.addRootRenderer(video);
    view.setPipeline(pipeline);
    setContentView(view);
    pipeline.startRendering();
    video.startWhenReady();
    view.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent me) {
            if (System.currentTimeMillis() - 100 > touchTime) {
                touchTime = System.currentTimeMillis();
                if (video.isPlaying()) {
                    video.stop();
                } else {
                    video.startWhenReady();
                }
            }
            return true;
        }

    });
}
 
Example 25
Project: CoordinatorLayoutSample   File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    findViewById(R.id.large_toolbar_fix).setOnClickListener(this);
    findViewById(R.id.scroll_toolbar).setOnClickListener(this);
    findViewById(R.id.collapse_large_toolbar).setOnClickListener(this);
    findViewById(R.id.scroll_collapse_large_toolbar).setOnClickListener(this);
    findViewById(R.id.parallax_image_toolbar).setOnClickListener(this);
    findViewById(R.id.custom_behavior).setOnClickListener(this);
    findViewById(R.id.snackbar).setOnClickListener(this);
    findViewById(R.id.pager_tabs).setOnClickListener(this);
    findViewById(R.id.pager_tabs_fixed_image).setOnClickListener(this);
}
 
Example 26
Project: android   File: InterfaceFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.pref_interface);
    SettingsActivity.bindPreferenceSummaryToValue(findPreference("prayer_highlight"));
    SettingsActivity.bindPreferenceSummaryToValue(findPreference("ui_theme"));

    Preference showAmPm = findPreference("show_ampm");
    Preference widgetBackground = findPreference("widget_background_color");
    Preference widgetImsak = findPreference("widget_show_imsak");
    Preference widgetSyuruk = findPreference("widget_show_syuruk");
    Preference widgetDhuha = findPreference("widget_show_dhuha");
    Preference widgetMasihi = findPreference("widget_show_masihi");
    Preference widgetHijri = findPreference("widget_show_hijri");

    Preference.OnPreferenceChangeListener widgetChange = new Preference.OnPreferenceChangeListener() {
        @Override
        public boolean onPreferenceChange(Preference preference, Object o) {
            WidgetService.start(getActivity());
            return true;
        }
    };

    showAmPm.setEnabled(!DateFormat.is24HourFormat(getActivity()));
    widgetBackground.setOnPreferenceChangeListener(widgetChange);
    widgetImsak.setOnPreferenceChangeListener(widgetChange);
    widgetSyuruk.setOnPreferenceChangeListener(widgetChange);
    widgetDhuha.setOnPreferenceChangeListener(widgetChange);
    widgetMasihi.setOnPreferenceChangeListener(widgetChange);
    widgetHijri.setOnPreferenceChangeListener(widgetChange);

    Dagger.getGraph(getActivity())
            .getAnalyticsProvider()
            .trackViewedScreen(AnalyticsProvider.SCREEN_SETTINGS_INTERFACE);
}
 
Example 27
Project: indigenous-android   File: Authenticator.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options)  {
    final Intent intent = new Intent(context, IndieAuthActivity.class);
    intent.putExtra("com.indieweb.indigenous.AccountType", accountType);
    intent.putExtra(IndieAuthActivity.TOKEN_TYPE, authTokenType);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 28
Project: android_9.0.0_r45   File: FragmentNavigator.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@Nullable
public Bundle onSaveState() {
    Bundle b = new Bundle();
    int[] backStack = new int[mBackStack.size()];
    int index = 0;
    for (Integer id : mBackStack) {
        backStack[index++] = id;
    }
    b.putIntArray(KEY_BACK_STACK_IDS, backStack);
    return b;
}
 
Example 29
Project: Travel-Mate   File: CurrencyListViewActivity.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_conversion_listview);

    currences_names = new ArrayList<>();
    mListview = findViewById(R.id.listView);
    mCurrencySearch = findViewById(R.id.currencySearch);

    mContext = this;
    addCurrencies();

    mCurrencySearch.addTextChangedListener(this);
}
 
Example 30
Project: XposedSmsCode   File: CodeRulesActivity.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_code_rules);
    ButterKnife.bind(this);

    // set up toolbar
    setupToolbar();

    handleIntent(getIntent());
}
 
Example 31
Project: iBeebo   File: AbsBaseTimeLineFragment.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onLoadFinished(Loader<AsyncTaskLoaderResult<T>> loader, AsyncTaskLoaderResult<T> result) {

    T data = result != null ? result.data : null;
    WeiboException exception = result != null ? result.exception : null;
    Bundle args = result != null ? result.args : null;

    switch (loader.getId()) {
        case NEW_MSG_LOADER_ID:
            mTimeLineSwipeRefreshLayout.setRefreshing(false);
            if (Utility.isAllNotNull(exception)) {
                if (isDebug || !exception.getError().trim().equals("用户请求超过上限")) {
                    newMsgTipBar.setError(exception.getError());
                }

                onNewMsgLoaderFailedCallback(exception);
            } else {
                onNewMsgLoaderSuccessCallback(data, args);
            }
            break;
        case OLD_MSG_LOADER_ID:

            if (exception != null) {
                showErrorFooterView();
                onOldMsgLoaderFailedCallback(exception);
            } else if (data != null) {
                mCanLoadOldData = data.getSize() > 1;
                onOldMsgLoaderSuccessCallback(data);
                getAdapter().notifyDataSetChanged();
                dismissFooterView();
            } else {
                mCanLoadOldData = false;
                dismissFooterView();
            }
            break;
    }
    getLoaderManager().destroyLoader(loader.getId());
}
 
Example 32
Project: deltachat-android   File: ImageEditorFragment.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);

  imageEditorHud  = view.findViewById(R.id.scribble_hud);
  imageEditorView = view.findViewById(R.id.image_editor_view);

  imageEditorHud.setEventListener(this);

  imageEditorView.setTapListener(selectionListener);
  imageEditorView.setDrawingChangedListener(this::refreshUniqueColors);
  imageEditorView.setUndoRedoStackListener(this::onUndoRedoAvailabilityChanged);

  EditorModel editorModel = null;

  if (restoredModel != null) {
    editorModel = restoredModel;
    restoredModel = null;
  } else if (savedInstanceState != null) {
    editorModel = new Data(savedInstanceState).readModel();
  }

  if (editorModel == null) {
    editorModel = new EditorModel();
    EditorElement image = new EditorElement(new UriGlideRenderer(imageUri, true, imageMaxWidth, imageMaxHeight));
    image.getFlags().setSelectable(false).persist();
    editorModel.addElement(image);
  }

  imageEditorView.setModel(editorModel);

  refreshUniqueColors();
}
 
Example 33
Project: Android-ObservableScrollView   File: ActionBarControlGridViewActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_actionbarcontrolgridview);

    ObservableGridView gridView = (ObservableGridView) findViewById(R.id.grid);
    gridView.setScrollViewCallbacks(this);
    setDummyData(gridView);
}
 
Example 34
Project: Android-Pull-To-Refresh   File: BaseLogActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    if (showLifeInfo)
        CommonLog.e(TAG, "onRestoreInstanceState");
    logThreadInfo();
}
 
Example 35
Project: AndroidHttpCapture   File: HarDetailActivity.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scrolling);
    ButterKnife.bind(this);

    setupActionBar();

    try {
        initHarLog(getIntent().getIntExtra("pos", -1));
    } catch (Exception e) {
        e.printStackTrace();
        finish();
    }
}
 
Example 36
Project: letv   File: ServiceInterface.java    License: Apache License 2.0 5 votes vote down vote up
public static void a(Context context, String str) {
    if (context != null && !e(context)) {
        if (b() || !e.n) {
            a.a(context, str);
            return;
        }
        Intent intent = new Intent(context, PushService.class);
        Bundle bundle = new Bundle();
        bundle.putInt(z[1], 4);
        bundle.putString(z[0], str);
        intent.setAction(z[2]);
        intent.putExtras(bundle);
        context.startService(intent);
    }
}
 
Example 37
Project: budget-watch   File: ReceiptViewActivity.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    setContentView(R.layout.receipt_view_activity);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null)
    {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    final Bundle b = getIntent().getExtras();
    receiptFilename = b.getString("receipt");

    final WebView receiptView = (WebView) findViewById(R.id.imageView);
    receiptView.getSettings().setBuiltInZoomControls(true);
    receiptView.getSettings().setAllowFileAccess(true);

    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);

    String data = "<html><body>" +
            "<img width=\"" + size.x + "\" " +
            "src=\"file://" + receiptFilename + "\"/>" +
            "</body></html>";

    receiptView.loadDataWithBaseURL("", data, "text/html", "utf-8", null);
}
 
Example 38
Project: DeviceConnect-Android   File: IRKitVirtualProfileListFragment.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {

    mDBHelper = new IRKitDBHelper(getActivity());
    mVirtualProfileAdapter = new VirtualProfileAdapter(getActivity(), createDeviceContainers());
    View rootView = inflater.inflate(R.layout.fragment_profilelist, container, false);

    mListView = (ListView) rootView.findViewById(R.id.listview_devicelist);
    mListView.setItemsCanFocus(true);
    mListView.setAdapter(mVirtualProfileAdapter);
    return rootView;
}
 
Example 39
Project: container   File: VAccountManager.java    License: GNU General Public License v3.0 5 votes vote down vote up
public void updateCredentials(IAccountManagerResponse response, Account account, String authTokenType, boolean expectActivityLaunch, Bundle loginOptions) {
	try {
		getRemote().updateCredentials(VUserHandle.myUserId(), response, account, authTokenType, expectActivityLaunch, loginOptions);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
Example 40
Project: LifecycleFragment   File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    logScroll = findViewById(R.id.log_scroll);
    log = findViewById(R.id.log);

    pager = findViewById(R.id.pager);
    pager.setAdapter(new FirstAdapter(getSupportFragmentManager()));

    tab = findViewById(R.id.tab);
    tab.setupWithViewPager(pager);
}