@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (data != null && data.getData() != null && resultCode == Activity.RESULT_OK) { if (requestCode == REQUEST_EXPORT_CODE) { final File exportFile = Utils.getFileForUri(data.getData()); if (!exportFile.getParentFile().canWrite() || !exportFile.getParentFile().canRead()) { Toast.makeText(activity, R.string.invalid_directory, Toast.LENGTH_SHORT).show(); } else { activity.startService(new Intent(activity, SubscriptionsExportService.class) .putExtra(SubscriptionsExportService.KEY_FILE_PATH, exportFile.getAbsolutePath())); } } else if (requestCode == REQUEST_IMPORT_CODE) { final String path = Utils.getFileForUri(data.getData()).getAbsolutePath(); ImportConfirmationDialog.show(this, new Intent(activity, SubscriptionsImportService.class) .putExtra(KEY_MODE, PREVIOUS_EXPORT_MODE) .putExtra(KEY_VALUE, path)); } } } /*/////////////////////////////////////////////////////////////////////////
private void openPopupPlayer(final boolean append) { if (!PermissionHelper.isPopupEnabled(activity)) { PermissionHelper.showPopupEnablementToast(activity); return; } final PlayQueue itemQueue = new SinglePlayQueue(currentInfo); if (append) { NavigationHelper.enqueueOnPopupPlayer(activity, itemQueue); } else { Toast.makeText(activity, R.string.popup_playing_toast, Toast.LENGTH_SHORT).show(); final Intent intent = NavigationHelper.getPlayerIntent( activity, PopupVideoPlayer.class, itemQueue, getSelectedVideoStream().resolution ); activity.startService(intent); } }
/** * Update the series recording with the given values. */ private void updateSeriesRecording() { Intent intent = getIntentData(); intent.setAction("updateAutorecEntry"); intent.putExtra("id", id); activity.startService(intent); activity.finish(); }
private void updateRecording() { Intent intent = getIntentData(); intent.setAction("updateDvrEntry"); intent.putExtra("id", id); activity.startService(intent); activity.finish(); }
/** * Updates the timer recording with the given values. * If the API version supports it, use the native service call method * otherwise the old recording is removed and a new one with the * edited values is added afterwards. This is done in the service */ private void updateTimerRecording() { Intent intent = getIntentData(); intent.setAction("updateTimerecEntry"); intent.putExtra("id", id); activity.startService(intent); activity.finish(); }
private void addRecording() { Intent intent = getIntentData(); intent.setAction("addDvrEntry"); activity.startService(intent); activity.finish(); }
/** * Adds a new series recording with the given values. This method is also * called when a recording is being edited. It adds a recording with edited * values which was previously removed. */ private void addSeriesRecording() { Intent intent = getIntentData(); intent.setAction("addAutorecEntry"); activity.startService(intent); activity.finish(); }
/** * Adds a new timer recording with the given values. This method is also * called when a recording is being edited. It adds a recording with edited * values which was previously removed. */ private void addTimerRecording() { Intent intent = getIntentData(); intent.setAction("addTimerecEntry"); activity.startService(intent); activity.finish(); }
@Override public void onBottomReached(int position) { // Do not load more programs when a search query was given or all programs were loaded. if (isSearchActive || !loadingMoreProgramAllowed || !isNetworkAvailable) { return; } loadingMoreProgramAllowed = false; loadingProgramAllowedHandler.postDelayed(loadingProgramsAllowedTask, 2000); Program lastProgram = recyclerViewAdapter.getItem(position); Timber.d("Loading more programs after " + lastProgram.getTitle()); Intent intent = new Intent(activity, EpgSyncService.class); intent.setAction("getEvents"); intent.putExtra("eventId", lastProgram.getNextEventId()); intent.putExtra("channelId", lastProgram.getChannelId()); intent.putExtra("channelName", channelName); intent.putExtra("numFollowing", 25); intent.putExtra("showMessage", true); if (MainApplication.isActivityVisible()) { activity.startService(intent); } }