Office Hours — Today, July 12

Tuesday, July 10

Jul 12
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
Bruce F.
has entered the room
Mark M.
howdy, Bruce!
how can I help you today?
Bruce F.
Hi mark
7:30 PM
Bruce F.
I'm attempting to save and restore a jpeg to sd card...
The save part seems to work, if I understand linux files, but not so good on retrieving and putting it in a view. My path is String path = Environment.getExternalStorageDirectory().toString();
View paste
Here is what I'm doing to get it back: String pathIn = Environment.getExternalStorageDirectory()+ "Wallpaper.bmp"; 
      File imgFile = new File(pathIn);
      if(imgFile.exists()){
        Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
        ImageView imageView1 = (ImageView) findViewById( R.id.imageView1 );
        imageView1.setImageBitmap( myBitmap );
Mark M.
Use new File(Environment.getExternalStorageDirectory(), "Wallpaper.bmp")
use that for imgFile
you are assuming that Environment.getExternalStorageDirectory() ends in a slash in your current code
which is probably incorrect
BTW, if this is a JPEG, why the .bmp extension?
Bruce F.
I think I tried it as an alternate solution.
Mark M.
what are your symptoms?
Bruce F.
The view never shows the jpeg.
7:35 PM
Mark M.
have you used breakpoints or logging to see if you make it past if (imgFile.exists()) ?
Bruce F.
no
Mark M.
start there
my theory #1 is that it is the string concatention
my theory #2 is that it is the .bmp file extension, confusing BitmapFactory into thinking the file is a BMP file, not a JPEG file
Bruce F.
thank you
7:45 PM
Mark M.
if you have any other questions, feel free to chime in
it's not like the chat room overfloweth this evening... :-)
Bruce F.
I noticed...
imeoptions actiondone in a fragment xml file is not doing what I expect
the keyboard stays on screen, and remains when switching to other tabbed fragments
Mark M.
I always manually dismiss the IME on an action
in that project, I use the IME action for an EditText in the action bar
I dismiss the IME when the action is invoked (pressing the action button or pressing Enter)
7:50 PM
Bruce F.
Thanks. One more...
I have an IME that automatically opens in ICS, but stays closed until the edit text is pressed in Gingerbread. And the ICS implementation was fine until I place a date picker under it in the layout
Mark M.
um, OK
what specifically is the problem?
7:55 PM
Bruce F.
The IME automatically opens up in the ICS implementation. I don't want that.
Mark M.
you will have to give something else the focus, then
Bruce F.
Didn't think of that.
One more then. I themed the Sherlock Action bar with Gilfelt's generator, but the style disappears in landscape.
Mark M.
that's certainly strange
ABS doesn't have landscape-specific styles, as far as I see in GitHu
er, GitHub
I don't know off the top of my head what might cause that behavior
Jake runs a Google Group for ABS -- you might inquire there
8:00 PM
Bruce F.
The official I/O 2012 does the exact same thing.
Mark M.
well, IIRC, they're using ABS
Bruce F.
Okay, I'll ask on the Google group.
Mark M.
yeah, I don't see an issue on GitHub for this
Bruce F.
Thank you for your (exclusive) tutoring today.
Mark M.
sure, no problem
Bruce F.
Bye
Bruce F.
has left the room
8:30 PM
Mark M.
turned off guest access

Tuesday, July 10

 

Office Hours

People in this transcript

  • Bruce F
  • Mark Murphy