List of usage examples for android.os Bundle putStringArray
public void putStringArray(@Nullable String key, @Nullable String[] value)
From source file:de.aw.monma.actions.FragmentPayeeListe.java
@Override protected void setInternalArguments(Bundle args) { super.setInternalArguments(args); args.putParcelable(DBDEFINITION, tbd); args.putInt(LAYOUT, layout);//from w w w. j a va 2 s. c o m args.putInt(VIEWHOLDERLAYOUT, viewHolderLayout); args.putStringArray(PROJECTION, projection); args.putString(SELECTION, selection); args.putStringArray(SELECTIONARGS, selectionArgs); }
From source file:de.aw.monma.wertpapier.FragmentWertpapierKurseListe.java
@Override public void setCursorLoaderArguments(int id, Bundle args) { args.putString(ORDERBY, orderBy);// ww w .j a v a 2 s. co m args.putString(SELECTION, selection); Long wpid = args.getLong(WPID); String[] selectionArgs = new String[] { String.valueOf(wpid) }; args.putStringArray(SELECTIONARGS, selectionArgs); }
From source file:com.sweetiepiggy.littlepro.QuestionFragment.java
@Override public void onSaveInstanceState(Bundle savedInstanceState) { savedInstanceState.putLong(ARG_QUESTION_ID, mQuestion.getId()); savedInstanceState.putString(ARG_QUESTION, mQuestion.getQuestion()); savedInstanceState.putStringArray(ARG_ANSWER_CHOICES, mQuestion.getAnswerChoices().toArray(new String[0])); savedInstanceState.putString(ARG_ANSWER, getAnswer()); savedInstanceState.putInt(ARG_POINTS, mQuestion.getPoints()); savedInstanceState.putBoolean(ARG_SUBMITTED, mSubmitted); super.onSaveInstanceState(savedInstanceState); }
From source file:es.esy.vivekrajendran.news.MainActivity.java
@Override public boolean onQueryTextSubmit(String query) { searchView.setVisibility(View.VISIBLE); Bundle bundle = new Bundle(); bundle.putBoolean("isSearch", true); bundle.putStringArray("query", new String[] { query }); LatestNewsFragment latestNewsFragment = new LatestNewsFragment(); latestNewsFragment.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.main_frame, latestNewsFragment).commit(); searchView.clearFocus();// w w w . ja v a 2 s .co m return true; }
From source file:com.alusorstroke.jjvm.MainActivity.java
public void showFragment(Fragment fragment, String[] extra, String title) { Bundle bundle = new Bundle(); bundle.putStringArray(FRAGMENT_DATA, extra); fragment.setArguments(bundle);/*from w w w. jav a 2s.c o m*/ FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.container, fragment).commitAllowingStateLoss(); if (!useTabletMenu()) setTitle(title); }
From source file:eu.operando.operandoapp.util.NotificationUtil.java
public void displayExfiltratedNotification(Context context, String applicationInfo, Set<RequestFilterUtil.FilterType> exfiltrated, int mainNotificationId) { try {/*w ww. ja v a2 s. co m*/ StringBuilder sb = new StringBuilder(); for (RequestFilterUtil.FilterType f : exfiltrated) { sb.append(f + ", "); } sb.delete(sb.length() - 2, sb.length() - 1); RemoteViews smallContentView = new RemoteViews(context.getPackageName(), R.layout.proxy_notification_small); smallContentView.setImageViewResource(R.id.image, R.drawable.logo_bevel); smallContentView.setTextViewText(R.id.titleTxtView, "Personal Information"); smallContentView.setTextViewText(R.id.subtitleTxtView, "Expand for more info"); RemoteViews bigContentView = new RemoteViews(context.getPackageName(), R.layout.proxy_notification_large); bigContentView.setImageViewResource(R.id.image, R.drawable.logo_bevel); bigContentView.setTextViewText(R.id.titleTxtView, "Personal Information"); bigContentView.setTextViewText(R.id.subtitleTxtView, applicationInfo.replaceAll("\\s\\(.*?\\)", "") + " requires access to " + sb); bigContentView.setTextViewText(R.id.allowBtn, "Allow"); bigContentView.setTextViewText(R.id.blockBtn, "Block"); //get exfiltrated info to string array String[] exfiltrated_array = new String[exfiltrated.size()]; int i = 0; for (RequestFilterUtil.FilterType filter_type : exfiltrated) { exfiltrated_array[i] = filter_type.name(); i++; } //set listeners for notification buttons Intent allowIntent = new Intent(context, NotificationActivityReceiver.class); allowIntent.setAction("allow"); Bundle allowBundle = new Bundle(); allowBundle.putString("appInfo", applicationInfo); allowBundle.putInt("notificationId", mainNotificationId); allowBundle.putStringArray("exfiltrated", exfiltrated_array); allowIntent.putExtras(allowBundle); PendingIntent pendingAllowIntent = PendingIntent.getBroadcast(context, mainNotificationId + 1, allowIntent, PendingIntent.FLAG_UPDATE_CURRENT); bigContentView.setOnClickPendingIntent(R.id.allowBtn, pendingAllowIntent); Intent blockIntent = new Intent(context, NotificationActivityReceiver.class); blockIntent.setAction("block"); Bundle blockBundle = new Bundle(); blockBundle.putString("appInfo", applicationInfo); blockBundle.putInt("notificationId", mainNotificationId); blockBundle.putStringArray("exfiltrated", exfiltrated_array); blockIntent.putExtras(blockBundle); PendingIntent pendingBlockIntent = PendingIntent.getBroadcast(context, mainNotificationId + 2, blockIntent, PendingIntent.FLAG_UPDATE_CURRENT); bigContentView.setOnClickPendingIntent(R.id.blockBtn, pendingBlockIntent); Notification.Builder mBuilder = new Notification.Builder(context).setSmallIcon(R.drawable.logo_bevel) .setContent(smallContentView); Notification proxyNotification = mBuilder.build(); proxyNotification.defaults |= Notification.DEFAULT_ALL; proxyNotification.bigContentView = bigContentView; NotificationManager mNotificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(mainNotificationId, proxyNotification); DatabaseHelper db = new DatabaseHelper(context); db.addPendingNotification(new PendingNotification(applicationInfo, TextUtils.join(", ", exfiltrated_array), mainNotificationId)); } catch (Exception e) { Log.d("ERROR", e.getMessage()); } }
From source file:de.aw.monma.hbci.FragmentHBCIBanken.java
@Override protected void setInternalArguments(Bundle args) { super.setInternalArguments(args); args.putParcelable(DBDEFINITION, tbd); args.putInt(LAYOUT, layout);//from w w w. j a va2 s. c o m args.putInt(VIEWHOLDERLAYOUT, viewHolderLayout); args.putString(SELECTION, selection); args.putStringArray(SELECTIONARGS, selectionArgs); args.putString(ORDERBY, orderBy); }
From source file:de.aw.monma.snippets.SnippetDepotUebersicht.java
@Override protected void setInternalArguments(Bundle args) { super.setInternalArguments(args); args.putParcelable(DBDEFINITION, tbd); args.putInt(VIEWHOLDERLAYOUT, detailView); args.putIntArray(VIEWRESIDS, viewResIDs); args.putStringArray(PROJECTION, projection); args.putString(SELECTION, selection); args.putString(GROUPBY, groupBy);// w ww . ja v a2 s. com args.putString(ORDERBY, orderBy); Calendar cal = Calendar.getInstance(); year = cal.get(Calendar.YEAR); }
From source file:com.zegoggles.smssync.service.SmsBackupService.java
private void handleErrorState(BackupState state) { if (state.isAuthException()) { appLog(R.string.app_log_backup_failed_authentication, state.getDetailedErrorMessage(getResources())); if (shouldNotifyUser(state)) { notifyUser(NOTIFICATION_ID_WARNING, notificationBuilder(stat_sys_warning, getString(R.string.notification_auth_failure), getString(getAuthPreferences().useXOAuth() ? R.string.status_auth_failure_details_xoauth : R.string.status_auth_failure_details_plain))); }/*from w ww . ja v a 2s . c o m*/ } else if (state.isConnectivityError()) { appLog(R.string.app_log_backup_failed_connectivity, state.getDetailedErrorMessage(getResources())); } else if (state.isPermissionException()) { if (state.backupType != MANUAL) { Bundle extras = new Bundle(); extras.putStringArray(MainActivity.EXTRA_PERMISSIONS, state.getMissingPermissions()); notifyUser(NOTIFICATION_ID_WARNING, notificationBuilder(R.drawable.ic_notification, getString(R.string.notification_missing_permission), formatMissingPermissionDetails(getResources(), state.getMissingPermissions())) .setContentIntent(getPendingIntent(extras))); } } else { appLog(R.string.app_log_backup_failed_general_error, state.getDetailedErrorMessage(getResources())); if (shouldNotifyUser(state)) { notifyUser(NOTIFICATION_ID_WARNING, notificationBuilder(stat_sys_warning, getString(R.string.notification_general_error), state.getErrorMessage(getResources()))); } } }
From source file:com.kiwi.auready.util.view.ColorPickerDialog.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putIntArray(KEY_COLORS, mColors); outState.putSerializable(KEY_SELECTED_COLOR, mSelectedColor); outState.putStringArray(KEY_COLOR_CONTENT_DESCRIPTIONS, mColorContentDescriptions); }