Mar 20 | 7:15 PM |
Mark M. | has entered the room |
Mar 20 | 7:20 PM |
Mark M. | turned on guest access |
Mar 20 | 7:30 PM |
Ron T. | has entered the room |
Mark M. |
howdy, Ron!
|
Mark M. |
how can I help you today?
|
Ron T. |
Evening Mark. I have a quick question(s) about WebView...
|
David O. | has entered the room |
David O. |
Hello
|
Mark M. |
Ron: go ahead
|
Mark M. |
(BTW, howdy, David!)
|
Ron T. |
I've build a successful WebView app including the webviewclient using the loadURL method
|
David O. |
Howdy Mark
|
Ron T. |
I'm trying to use the loaddatawithbaseurl method
|
Ron T. |
I notice that the onReceived event does NOT fire on it if there is no connectivity to the URL, Is this normal?
|
Mark M. |
onReceived?
|
Mark M. |
do you mean onReceivedError()?
|
Ron T. |
Oops, onReceivedError correct!
|
Mark M. |
in that case, that can be normal
|
Mark M. |
the URL supplied to loadDataWithBaseURL() is used for relative URLs in the HTML being loaded
|
Ron T. |
Yes, we figure it is trying to load down css.
|
Mark M. |
so, you won't get onReceivedError() for the HTML you are loading, itself
|
Ron T. |
If there is no connectivity to the URL and we can't get the css, we want the error taken...
|
Mark M. |
you're saying that you are not getting onReceivedError() for your CSS?
|
Mar 20 | 7:35 PM |
Ron T. |
What it does is display the HTML I've got directly over the background which looks bad.
|
Mark M. |
hmmmm
|
Mark M. |
the docs for onReceivedError() refer to "the main resource"
|
Mark M. |
perhaps that is not used for images, CSS, etc.
|
Mark M. |
I have not used onReceivedError() personally
|
Ron T. |
yes, if you use the loadurl, it takes the error and lets us display a nice message...
|
Mark M. |
:: shrug ::
|
Ron T. |
We have previously read the HTML on async and have buffered it.
|
Ron T. |
I'll play with it more but it would be nice to have a flag to let us error if we can't load resources!
|
Mark M. |
my best guess is that onReceivedError() is for pages, not other resources (images, CSS, etc.), but that is just a guess
|
Mark M. |
sorry I couldn't be of more help on that one
|
Ron T. |
Okay, just wanted to make sure I wasn't missing something. Over and out for now! Thanks!
|
Ron T. | has left the room |
Mark M. |
David: do you have question?
|
David O. |
I have a few...
|
Mark M. |
go right ahead!
|
David O. |
Are you familiar with the ActionBarSherlock library?
|
Mark M. |
somewhat
|
Mark M. |
I've used it
|
Mark M. |
but I have not used every feature
|
David O. |
I'm having problems setting it up and using ti
|
Mar 20 | 7:40 PM |
David O. |
the 3.5.1 version seems to work, but it is missing most of its themes
|
David O. |
when I try to use the sherlock themes from the 4.0 version eclipse crashes with a stackoverflow exception
|
David O. |
and crashes when it opens unless I remove the theme
|
Mark M. |
*Eclipse* crashes?
|
David O. |
yes
|
Mark M. |
I haven't seen that
|
David O. |
i'm using windows
|
Mark M. |
:: insert Windows joke here ::
|
Mark M. |
:-)
|
David O. |
me
|
David O. |
i'm joke's on me
|
Mark M. |
I am running Eclipse Indigo on Linux
|
Mark M. |
I have not seen Eclipse crash with a stack overflow
|
David O. |
i tried seeting up ubuntu on my latop, but I can't because I have an Nvidia card with Optimus technology
|
Mark M. |
so do I
|
David O. |
I'm going to make the switch eventually
|
David O. |
i couldn't get the dual monitors working
|
David O. |
I went through a process where you had to install the propreitary driver and uninstall the linux driver
|
David O. |
that also crashed...i eventually gave up
|
David O. |
but linux is much better
|
David O. |
I'll stick to course material thought :)
|
David O. |
and watch the typos....
|
Mark M. |
anyway, I don't know what to tell you about an ABS-triggered Eclipse crash
|
David O. |
I posted something on the ABS users group
|
Mark M. |
are you on the latest Android tools release?
|
David O. |
no
|
David O. |
what it is 16?
|
Mark M. |
hold on
|
Mark M. |
yes, 16
|
Mar 20 | 7:45 PM |
Mark M. |
17 should be released fairly soon
|
David O. |
then I guess I am
|
Mark M. |
OK, so that's not it
|
David O. |
Here's a different question
|
David O. |
I think the problem is with referencing the ABS theme's
|
David O. |
they don't seem to be with the library
|
David O. |
if you actually look in the library there is no res file
|
Mark M. |
the themes are definitely with the library
|
David O. |
there is abs_styles
|
David O. |
let me try something
|
Mark M. |
um, there definitely is a res/ directory in the ABS library project
|
David O. |
yes
|
Mark M. |
at least, in the one I downloaded
|
David O. |
you are correct..
|
David O. |
i had one that I had imported improperly...I fixed that
|
David O. |
the ABS themes are actually showing up in the graphical editor theme picker
|
David O. |
should I be picking @abs_style/Theme.Sherlock.?
|
Mark M. |
I have @style/Theme.Sherlock
|
Mark M. |
@abs_style should fail to compile
|
David O. |
Also, is it necessary to use a Sherlock theme...their documentation says that you need one on each activity using an ActionBar
|
Mar 20 | 7:50 PM |
David O. |
but it seems to work in 3.0 and up devices without a regular theme
|
Mark M. |
I believe you need to use one of Jake's themes, if not directly then as the parent of your own custom theme
|
David O. |
i've been extending his theme when I'm using it
|
Mark M. |
that should be fine
|
David O. |
Ok
|
David O. |
I have a differnt question
|
David O. |
I'm trying to create a 'menu' and 'submenu' panel using two gridviews
|
David O. |
the first gridview acts as a filter, when you click on a ImageButton it drops down another gridview with menu options
|
David O. |
do you follow?
|
Mark M. |
so far
|
David O. |
I am able to animate a 'slide_down' using a translate_animation
|
David O. |
but I can't seem to get a 'slide_up' animation to work
|
Mar 20 | 7:55 PM |
David O. |
I used the same code...and just reversed the fromY and toY parameters
|
Mark M. |
what was the effect?
|
David O. |
the close animation doesn't work
|
Mark M. |
define "doesn't work"
|
David O. |
i'm calling setVisibility(GridView.GONE) right afterwards though
|
David O. |
Here is the relevant code:
|
David O. |
hold on
|
David O. |
...also as a side note I'm having some trouble translating the animation into an anim.xml file
|
Mark M. |
define "doesn't work"
|
David O. |
doesn't work means that there is no animation
|
David O. |
the submenu dissapears without sliding back up
|
David O. |
i can't open the workspace with the project because when eclipse crashed it seems to have taken the workspace with it!
|
David O. |
eclipse is saying that my workspace is in use
|
Mark M. |
close the Eclipse you just opened, then use Task Manager to see if you have other copies of eclipse.exe floating around
|
David O. |
i tried that...
|
David O. |
one more time...
|
Mar 20 | 8:00 PM |
David O. |
i don't know
|
David O. |
i closed all eclipse & adb processes it still not working
|
Mark M. |
it might take a reboot, if Windows is holding some locks yet on the files
|
David O. |
usually I have to restart my computer to fix this
|
Mark M. |
regardless, I do not know why you would have a
problem with what you described, unless animating something scrollable
is somehow different
|
Mark M. |
I have only animated non-scrollable items (buttons, LinearLayouts of misc widgets, etc.)
|
David O. |
The gridviews don't have scrollbars
|
David O. |
okay
|
Mark M. |
compare your code with my SlidingPanel demos from
_The Busy Coder's Guide to Advanced Android Development_ and see if you
see any notable differences
|
David O. |
I'd like to translate the animation into an anim.xml file and then load it using the AnimUtils.LoadLayoutAnimation
|
Mark M. |
I seem to recall that TranslateAnimation in XML is funky
|
David O. |
Can I copy and paste code into the chat?
|
Mark M. |
sure
|
David O. |
it's missing parameters
|
David O. |
i can tell you that
|
Mar 20 | 8:05 PM |
David O. |
you can't set what the animation is relative to,
programmatically you can set whether the animation is relative to the
parent or to 'itself'...whatever that means
|
Mark M. |
right
|
Mark M. |
I've only ever used it on one (proprietary) project, and I recall it took me a while to figure out the right values to use
|
David O. |
View paste
|
David O. |
hmm..is it better to use the android animations?
|
Mark M. |
what do you mean by "the android animations"?
|
David O. |
the one's in the sdk
|
Mark M. |
well, there's nothing wrong with those, if they happen to meet your needs
|
David O. |
there are animations in the sdk resource folder
|
Mark M. |
they might not be truly in the SDK in terms of android.R.anim references
|
David O. |
either way I would run into the same problem with this particular case
|
Mark M. |
you might need to copy them into your project
|
David O. |
I'll make sure to do that
|
David O. |
from what I've read online, you have to define a
layoutAnimation in a layoutAnimation tag, and have it reference a
translate animation
|
David O. |
then you load the layoutAnimation and it returns a LayoutAnimationController...
|
Mark M. |
I have not used layoutAnimation
|
David O. |
but my android:id tags are not showing us references
|
David O. |
should I stick to material from the books?
|
David O. |
I'm fine with that
|
Mark M. |
it's more that I can't help you with things I don't know :-)
|
Mar 20 | 8:10 PM |
David O. |
cool
|
Mar 20 | 8:10 PM |
Mark M. |
animations on the whole are not my strong suit
|
David O. |
not mine either...
|
David O. |
they are a bit tricky
|
David O. |
i have a few quesitons about fragments
|
Mark M. |
ok
|
David O. |
I read throught your notes on the FeedsReader project
|
David O. |
I'm unclear on exactly what the relationship is between the fragment stack and activity they are attached to
|
David O. |
if an activity is actually destroyed, what happens to the fragmetns attached to it?
|
Mark M. |
they are garbage collected
|
Mark M. |
just as their views are
|
Mark M. |
fragments do not live outside their activity
|
David O. |
ok
|
David O. |
what if you add the fragment to the backstack?
|
Mark M. |
that simply means a BACK press will first reverse the FragmentTransaction
|
Mark M. |
another BACK press would finish() the activity (if there are no other transactions)
|
David O. |
oh okay
|
Mark M. |
if the activity goes away for other reasons (e.g., you call finish()), the fragments still go away
|
David O. |
okay
|
David O. |
i tried replacing a fragment in a linear layout
|
David O. |
and it didn't work
|
David O. |
the original fragment wasn't replaced
|
Mark M. |
define "didn't work"
|
Mark M. |
you used replace() in a FragmentTransaction?
|
David O. |
is
|
David O. |
yes
|
Mar 20 | 8:15 PM |
Mark M. |
and the original fragment was also put there by a FragmentTransaction?
|
David O. |
when i chagned the layout to a relative layout it worked
|
David O. |
no
|
David O. |
the original fragment in the layout.xml file
|
Mark M. |
I have not tried replacing a static fragment (i.e., <fragment>) via a transaction
|
David O. |
I got it using getFragmentById
|
Mark M. |
I would not be surprised if there are issues there
|
David O. |
okay
|
David O. |
I'm also having some issues creating custom views
|
David O. |
I don't undrestand what the View.MeasureSpec object does
|
David O. |
and how it works
|
David O. |
are you familiar with it?
|
Mark M. |
I have only created composite custom views (e.g., ColorMixer)
|
Mark M. |
I have not created one that needed to worry about onMeasure() and such
|
Mark M. |
so I have no experience with View.MeasureSpec
|
David O. |
ok
|
David O. |
I had an issue with a cursor adapter...
|
David O. |
I had a database that was able to return values into an array
|
David O. |
but when I used a cursor adapter I got an ArrayIndexOutOfBounds exception
|
David O. |
because the query wasn't returning anything
|
David O. |
the cursor just had the database name so it should've translated into SELECT * FROM LINKS
|
Mar 20 | 8:20 PM |
David O. |
(I checked in the debugger, and this was correct)
|
Mark M. |
you should not get an ArrayIndexOutOfBounds exception for a Cursor with no rows
|
Mark M. |
as that is a perfectly normal occurrence
|
Mark M. |
CursorAdapter surely handles that
|
David O. |
hmm...
|
David O. |
can I email you more information?
|
Mark M. |
if you wish to go outside the chat, you are better served using StackOverflow
|
David O. |
okay
|
Mark M. |
looking at the source code, I don't see where CursorAdapter even has an array that might trigger such an exception
|
Mark M. |
you sure this isn't due to a bad column index?
|
David O. |
it could be
|
David O. |
to be honest it's been a week or two since I've looked at it
|
Mark M. |
hmmm... looking at more source code, that doesn't seem likely either
|
Mark M. |
anyway, I am not sure where you would get an ArrayIndexOutOfBoundsException related to a Cursor and CursorAdapter
|
David O. |
do you have anything on CursorAdapters in your books?
|
Mark M. |
yes, in a few places
|
Mark M. |
the chapter on databases in _The Busy Coder's Guide to Android Development_
|
David O. |
Ok cool
|
Mark M. |
the chapter on loaders in _The Busy Coder's Guide to Advanced Android Development_
|
Mark M. |
and probably a few other places as well
|
Mar 20 | 8:25 PM |
David O. |
Are loaders preferable to cursors?
|
Mark M. |
Loaders are a means of querying the database in the background
|
Mark M. |
to retrieve a Cursor
|
Mark M. |
Loaders do not replace Cursors -- in effect, they create them
|
David O. |
ok
|
David O. |
so they are on a seperate thread?
|
Mark M. |
yes
|
Mark M. |
usually, the loader uses an AsyncTask
|
David O. |
I am having some general problems controlling and assinging focus to elements ina view
|
David O. |
for example
|
David O. |
i have a listview with buttons on it
|
David O. |
it seems the button steals the focus from the listitem
|
Mark M. |
yes
|
David O. |
so if when you click on he listitem nothing happens
|
David O. |
what methods/parameters do you want to look at to assign/reassing focus between views and their children?
|
Mark M. |
well, specifically for your ListView scenario, I seem to recall that android:focusableInTouchMode is part of the solution
|
David O. |
okay
|
David O. |
I'll look into that
|
Mark M. |
personally, I don't like lists that use focusable widgets (Buttons, EditTexts, etc.), so I avoid the pattern
|
Mark M. |
in general, there are lots of focus-related
methods (e.g., requestFocus()) and attributes (e.g.,
android:nextFocusDown) for managing the focus
|
Mar 20 | 8:30 PM |
David O. |
ok
|
Mark M. |
that's a wrap for today's chat
|
David O. |
Mark, I need to go now
|
Mark M. |
next chat is Friday, 10am Eastern
|
David O. |
and so do you
|
Mark M. |
have a pleasant day!
|
David O. |
thanks, you too
|
David O. | has left the room |
Mark M. | turned off guest access |