Skip to main content

Home/ Android Dev/ Group items tagged putExtra

Rss Feed Group items tagged

Vincent Tsao

putExtra error on AppWidget - Android Developers | Google Groups - 0 views

  • I am just making some AppWidget and I want to pass some Strings through UpdateView to an Activity. But the Bundle is null. I try this: -Widget.java                       Intent defineIntent = new Intent(context, Visor.class);                        defineIntent.putExtra ("org.rss.androides.post2","artist");                        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, defineIntent, 0);                        updateViews.setOnClickPendingIntent (R.id.widget, pendingIntent); -Viewer.java           Bundle b = intent.getExtras();                 if (b == null) {                     finish();                     return;                 } b is always null.
  • Remember that PendingIntents aren't keyed using extras: http://groups.google.com/group/android-developers/msg/b296f43ae70c4587 You could hack the extras through by mangling them into Uri parameters, or if you're using a ContentProvider, just point to a specific row.
  • Or use PendingIntent.FLAG_UPDATE_CURRENT; just be careful that each active instance has its own unique Intent.
Vincent Tsao

Android SDK Quick Tip: Sending Pictures the Easy Way - 0 views

  • Intent picMessageIntent = new Intent(android.content.Intent.ACTION_SEND);  picMessageIntent.setType("image/jpeg");    File downloadedPic =  new File(      Environment.getExternalStoragePublicDirectory(      Environment.DIRECTORY_DOWNLOADS),      "q.jpeg");    picMessageIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));  
Vincent Tsao

android - Trying to attach a file from SD Card to email - Stack Overflow - 0 views

  • Path for me should have been file:///sdcard/DumbDumpers/DumbDumper.jpg
  • So in my example you need: emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+ sPhotoFileName));
1 - 3 of 3
Showing 20 items per page