List of usage examples for android.content Intent putStringArrayListExtra
public @NonNull Intent putStringArrayListExtra(String name, ArrayList<String> value)
From source file:com.gsma.rcs.ri.messaging.GroupTalkView.java
/** * Initiate a new Group Chat/*from w w w . ja v a2s. co m*/ * * @param ctx context * @param subject subject * @param participants list of participants */ public static void initiateGroupChat(Context ctx, String subject, ArrayList<String> participants) { Intent intent = new Intent(ctx, GroupTalkView.class); intent.setAction(INTITIATE_GROUPCHAT); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putStringArrayListExtra(GroupTalkView.EXTRA_PARTICIPANTS, participants); intent.putExtra(GroupTalkView.EXTRA_MODE, GroupChatMode.OUTGOING); intent.putExtra(GroupTalkView.EXTRA_SUBJECT, subject); ctx.startActivity(intent); }
From source file:com.hrs.filltheform.service.MyAccessibilityService.java
private void sendLoadedPackageNames(List<String> packageNames) { Intent intent = new Intent(INTENT_SEND_LOADED_PACKAGE_NAMES); intent.putStringArrayListExtra(INTENT_EXTRA_PACKAGE_NAMES, (ArrayList<String>) packageNames); sendBroadcast(intent);/*from w ww . jav a 2s . com*/ }
From source file:cm.aptoide.ptdev.adapters.ViewPagerAdapterScreenshots.java
@Override public Object instantiateItem(ViewGroup container, final int position) { final View v = LayoutInflater.from(context).inflate(R.layout.row_item_screenshots_big, null); final ProgressBar pb = (ProgressBar) v.findViewById(R.id.screenshots_loading_big); String icon;/* ww w . java 2 s . c o m*/ if (hd) { Log.d("Aptoide-Screenshots", "Icon is hd: " + url.get(position)); if (url.get(position).contains("_screen")) { icon = url.get(position).split("\\|")[1]; Log.d("Aptoide-Screenshots", "Icon is : " + icon); } else { icon = url.get(position); } } else { icon = screenshotToThumb(url.get(position)); } imageLoader.displayImage(icon, (ImageView) v.findViewById(R.id.screenshot_image_big), options, new ImageLoadingListener() { @Override public void onLoadingStarted(String uri, View view) { pb.setVisibility(View.VISIBLE); } @Override public void onLoadingFailed(String uri, View v, FailReason failReason) { ((ImageView) v.findViewById(R.id.screenshot_image_big)) .setImageResource(android.R.drawable.ic_delete); pb.setVisibility(View.GONE); } @Override public void onLoadingComplete(String uri, View v, Bitmap loadedImage) { pb.setVisibility(View.GONE); } @Override public void onLoadingCancelled(String uri, View v) { } }); container.addView(v); if (!hd) { v.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent i = new Intent(context, ScreenshotsViewer.class); i.putStringArrayListExtra("url", url); i.putExtra("position", position); i.putExtra("hashCode", hashCode + ".hd"); context.startActivity(i); } }); } return v; }
From source file:com.learnNcode.mediachooser.fragment.ImageFragment.java
private void setAdapter(Cursor imagecursor) { mGalleryModelList = new ArrayList<MediaModel>(); for (int i = 0; i < imagecursor.getCount(); i++) { imagecursor.moveToPosition(i);//w ww.j a v a2 s .c om int dataColumnIndex = imagecursor.getColumnIndex(MediaStore.Images.Media.DATA); MediaModel galleryModel = new MediaModel(imagecursor.getString(dataColumnIndex).toString(), false); mGalleryModelList.add(galleryModel); } mImageAdapter = new GridViewAdapter(getActivity(), 0, mGalleryModelList, false); mImageGridView.setAdapter(mImageAdapter); mImageGridView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // update the mStatus of each category in the adapter GridViewAdapter adapter = (GridViewAdapter) parent.getAdapter(); MediaModel galleryModel = (MediaModel) adapter.getItem(position); if ((MediaChooserConstants.MAX_MEDIA_LIMIT == MediaChooserConstants.SELECTED_MEDIA_COUNT) && (!galleryModel.status)) { Toast.makeText(getActivity(), getActivity().getResources().getString(R.string.max_limit_reach_error), Toast.LENGTH_SHORT).show(); } else { // inverse the status galleryModel.status = !galleryModel.status; adapter.notifyDataSetChanged(); if (galleryModel.status) { mSelectedItems.add(galleryModel.url.toString()); } else { mSelectedItems.remove(galleryModel.url.toString().trim()); } if (mCallback != null) { mCallback.onImageSelected(mSelectedItems.size()); Intent intent = new Intent(); intent.putStringArrayListExtra("list", mSelectedItems); getActivity().setResult(Activity.RESULT_OK, intent); } } } }); }
From source file:com.example.chilipepper.finalgooglemapsproject.MainActivity.java
/** Called when the user clicks the Add button */ public void openDetails(View view, Blip blip) { // Do something in response to button ArrayList<String> blipProps = new ArrayList<String>(); blipProps.add(blip.get_businessName()); blipProps.add(blip.get_address());/* ww w. j a v a 2 s. com*/ blipProps.add(blip.get_city()); blipProps.add(blip.get_state()); blipProps.add(blip.get_zip()); blipProps.add(blip.get_recordNum()); blipProps.add(blip.get_inspectionType()); blipProps.add(blip.get_violationDescr()); blipProps.add(blip.get_violationComments()); blipProps.add(blip.get_actionStatus()); Intent intent = new Intent(this, BlipActivity.class); intent.putStringArrayListExtra("Blip Properties", blipProps); startActivity(intent); }
From source file:com.garrocho.MapActivity.java
@SuppressLint("NewApi") @Override//from w w w.j a v a2s . c o m protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { musica = null; } else { musica = extras.getString("MUSICA"); } } else { musica = (String) savedInstanceState.getSerializable("MUSICA"); } mPrefs = new SimpleGeofenceStore(this); Intent intent = new Intent(); intent.putStringArrayListExtra(String.valueOf(GeofenceUtils.LISTA_GEOFENCES_ADDED), null); mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); if (mMap != null) { mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); mMap.setOnMapLongClickListener(new OnMapLongClickListener() { @Override public void onMapLongClick(final LatLng point) { CameraPosition INIT = new CameraPosition.Builder() .target(new LatLng(point.latitude, point.longitude)).zoom(17.5F).build(); mMap.animateCamera(CameraUpdateFactory.newCameraPosition(INIT)); // TODO Auto-generated method stub String names[] = { "25", "50", "100", "200", "400" }; final AlertDialog alertDialog = new AlertDialog.Builder(MapActivity.this, android.R.style.Theme_Translucent).create(); LayoutInflater inflater = getLayoutInflater(); View convertView = (View) inflater.inflate(R.layout.custom, null); alertDialog.setView(convertView); alertDialog.setTitle("Selecione um Radius"); ListView lv = (ListView) convertView.findViewById(R.id.listView1); ArrayAdapter<String> adapter = new ArrayAdapter<String>(MapActivity.this, android.R.layout.simple_list_item_1, names); lv.setAdapter(adapter); alertDialog.show(); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { String item = ((TextView) arg1).getText().toString(); SimpleGeofence geofence = new SimpleGeofence(String.valueOf(mPrefs.getQtdeGeo() + 1), point.latitude, point.longitude, Float.valueOf(item), GEOFENCE_EXPIRATION_IN_MILLISECONDS, Geofence.GEOFENCE_TRANSITION_ENTER, musica); addMarkerForFence(geofence); mPrefs.setGeofence(geofence.getId(), geofence); lista.add(geofence.getId()); Intent intent = new Intent(); intent.putStringArrayListExtra(String.valueOf(GeofenceUtils.LISTA_GEOFENCES_ADDED), lista); MapActivity.this.setResult(Activity.RESULT_OK, intent); alertDialog.dismiss(); Toast.makeText(MapActivity.this, "GeoFence Adicionada!", Toast.LENGTH_LONG).show(); } }); } }); desenharMakers(); mMap.setMyLocationEnabled(true); Location location = mMap.getMyLocation(); CameraPosition INIT = null; if (location == null) { locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); location = getLastBestLocation(); } INIT = new CameraPosition.Builder().target(new LatLng(location.getLatitude(), location.getLongitude())) .zoom(17.5F).build(); if (INIT != null) mMap.animateCamera(CameraUpdateFactory.newCameraPosition(INIT)); } }
From source file:edu.nimbus.glass.TopicMenuActivity.java
/** * This method here will either kill the live card, show or switch the view by starting the * feild select service./*from w w w . ja v a 2 s .c om*/ */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.stop: stopService(new Intent(this, TopicService.class)); return true; case R.id.graph_view: //create a list of fields from the current topic and have the user select which field to view. Log.d("Menu:", "Switching to graph view"); ArrayList<String> messageFields = createFieldList(mCompassService.getOriginalMessage()); Intent startIntent = new Intent(this, TopicFieldSelectActivity.class); startIntent.putStringArrayListExtra("field_names", messageFields); startIntent.putExtra("topic", mCompassService.getCurrentTopic()); startActivity(startIntent); return true; case R.id.text_view: //create a list of fields from the current topic and have the user select which field to view. Log.d("Menu:", "Switching to text view"); ArrayList<String> mFields = createFieldList(mCompassService.getOriginalMessage()); Intent sint = new Intent(this, TopicFieldSelectActivity.class); sint.putStringArrayListExtra("field_names", mFields); sint.putExtra("textual", true); sint.putExtra("topic", mCompassService.getCurrentTopic()); startActivity(sint); return true; default: return super.onOptionsItemSelected(item); /* * In the event of the user selecting "graph" or "text" and then * a specific field for an in depth view of that field, an intent will * be sent to the service, which in turn will forward the information * to the renderer. * * Messages will likely be of the form (0, field) for graphing and (1, field) for * in depth text and (2, null) for return to all topics view */ } }
From source file:br.liveo.ndrawer.ui.fragment.MainFragment52.java
private void startGalleryActivity() { ArrayList<String> images = new ArrayList<String>(); images.add("http://sourcey.com/images/stock/salvador-dali-metamorphosis-of-narcissus.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-the-dream.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-persistence-of-memory.jpg"); images.add("http://sourcey.com/images/stock/simpsons-persistence-of-memory.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-the-great-masturbator.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-metamorphosis-of-narcissus.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-the-dream.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-persistence-of-memory.jpg"); images.add("http://sourcey.com/images/stock/simpsons-persistence-of-memory.jpg"); images.add("http://sourcey.com/images/stock/salvador-dali-the-great-masturbator.jpg"); Intent intent = new Intent(getActivity(), GalleryActivity.class); intent.putStringArrayListExtra(GalleryActivity.EXTRA_NAME, images); startActivity(intent);//w w w. ja v a2s .c o m }
From source file:com.learnNcode.mediachooser.fragment.VideoFragment.java
private void setAdapter() { int count = mCursor.getCount(); mDataColumnIndex = mCursor.getColumnIndex(MEDIA_DATA); //move position to first element mCursor.moveToFirst();//from www. java 2 s . c o m mGalleryModelList = new ArrayList<MediaModel>(); for (int i = 0; i < count; i++) { mCursor.moveToPosition(i); String url = mCursor.getString(mDataColumnIndex); mGalleryModelList.add(new MediaModel(url, false)); } mVideoAdapter = new GridViewAdapter(getActivity(), 0, mGalleryModelList, true); mVideoAdapter.videoFragment = this; mVideoGridView.setAdapter(mVideoAdapter); mVideoGridView.setOnScrollListener(this); mVideoGridView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // update the mStatus of each category in the adapter GridViewAdapter adapter = (GridViewAdapter) parent.getAdapter(); MediaModel galleryModel = (MediaModel) adapter.getItem(position); if ((MediaChooserConstants.MAX_MEDIA_LIMIT == MediaChooserConstants.SELECTED_MEDIA_COUNT) && (!galleryModel.status)) { Toast.makeText(getActivity(), getActivity().getResources().getString(R.string.max_limit_reach_error), Toast.LENGTH_SHORT).show(); } else { // inverse the status galleryModel.status = !galleryModel.status; adapter.notifyDataSetChanged(); if (galleryModel.status) { mSelectedItems.add(galleryModel.url.toString()); } else { mSelectedItems.remove(galleryModel.url.toString().trim()); } if (mCallback != null) { mCallback.onVideoSelected(mSelectedItems.size()); Intent intent = new Intent(); intent.putStringArrayListExtra("list", mSelectedItems); getActivity().setResult(Activity.RESULT_OK, intent); } } } }); }
From source file:com.teclib.service.BootService.java
public void onCreate() { SurveillanceRunnable Surveillance = new SurveillanceRunnable(); mThread = new Thread(Surveillance); mThread.start();// w w w.ja v a 2s. c o m mContext = this.getBaseContext(); mIntentArgs = new ArrayList<String>(); //verification de l'enrolement mSharedPreferenceMQTT = new SharedPreferenceMQTT(); mSharedPreferenceAction = new SharedPreferenceAction(); String server = mSharedPreferenceMQTT.getServer(mContext); FlyveLog.d(server); if (server.equals("null")) { CustomNotification(0); } else { mIntentArgs.add("init"); Intent DeviceAdmin = new Intent(this.getBaseContext(), com.teclib.api.DeviceAdmin.class); DeviceAdmin.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); DeviceAdmin.putStringArrayListExtra("ControllerArgs", mIntentArgs); mContext.startActivity(DeviceAdmin); } mIsEmptyApks = mSharedPreferenceAction.getApks(mContext); FlyveLog.d(Arrays.toString(mIsEmptyApks.toArray()).toString()); if (!Arrays.toString(mIsEmptyApks.toArray()).equals("[null]")) { // Intent intent = new Intent(mContext,NotificationInstallService.class); // mContext.startService(intent); } mIsEmptyRemoveApks = mSharedPreferenceAction.getApksRemove(mContext); if (!Arrays.toString(mIsEmptyRemoveApks.toArray()).equals("[null]")) { Intent intentRemove = new Intent(mContext, NotificationRemoveService.class); mContext.startService(intentRemove); } }