Aug 10 | 7:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Aug 10 | 8:00 PM |
Julius | has entered the room |
Mark M. |
howdy, Julius
|
Julius |
Greetings amrk
|
Julius |
Mark
|
Julius |
(sorry bout that)
|
Mark M. |
no problem
|
Mark M. |
how can I help you today?
|
Julius |
I have a question regarding hte SQLiteDatabase and
errors I sem to have from time to time
|
Julius |
I am using the methods from your books
|
Julius |
to open the database and set it up
|
Julius | |
Julius |
and from time to time I get errors such as:
|
Julius |
java.lang.IllegalStateException: database not open
|
Julius |
I'm wondering have I somehow closed the database
unknowingly?
|
Mark M. |
where are you closing the database?
|
Julius |
in onDestroy()
|
Julius |
(pretty much in each Activity)
|
Mark M. |
one thing I have changed in my books is that I am
now holding onto the SQLiteOpenHelper object
|
Mark M. |
calling getReadableDatabase() and
getWriteableDatabase() as needed
|
Mark M. |
and closing the helper
|
Julius |
ah ok I might check that out
|
Julius |
thank you for the pointer
|
Julius |
I also have a general Java question probably
|
Julius |
I am downloading a file and I would like to be
able to stop or pause that process
|
Aug 10 | 8:05 PM |
Julius |
(it is in an Androi app)
|
Julius |
and I use:
|
Julius | |
Julius |
I'm trying to figure out a nice way of stopping
the download
|
Mark M. |
what's wrong with what you're using?
|
Julius |
um it doesn't appear to stop :)
|
Julius |
I'll get a bit more code to describe it better
|
Mark M. |
I assume shouldStop is an AtomicBoolean -- when
are you setting it to true?
|
Julius |
yes
|
Julius |
View paste
|
Julius |
I probably need to breakpoint to check when it's
being set
|
Mark M. |
shouldStopFlag is not shouldStop
|
Julius |
oh son of a ... :) <blush>
|
Aug 10 | 8:10 PM |
Julius |
thank you
|
Julius |
sorry for using up your time.
|
Mark M. |
not a problem
|
Julius |
is the approach right?
|
Julius |
for stopping the download?
|
Julius |
(one day it would be nice to have it litterally
pause and then carry on)
|
Mark M. |
in the abstract, it seems ok
|
Julius |
great thank you
|
Julius |
have a nice day/evening
|
Mark M. |
you too!
|
Julius | has left the room |
Mike R. | has entered the room |
Mark M. |
howdy, Mike R
|
Mike R. |
Hi Mark
|
Aug 10 | 8:15 PM |
Mike R. |
Just us?
|
Mark M. |
Julius just left
|
Mike R. |
ok. 2 questions
|
Mark M. |
fire away
|
Mike R. |
first one is a hard one. I have an EditText
widget on a view. when the widget gets the focus, the soft keyboard
appears and I have a listener that makes some instructions visible and
covers up other parts of the view.
|
Mike R. |
When the user presses the Search key on the
keyboard, I have a listener that removes the instructions, clears the
focus from the widget and does some processing.
|
Mike R. |
Problem is when the user presses the Back key, the
soft keyboard disappears, but I'm not getting any kind of notification
that this is happening. So I can't remove the instructions and clear
focus on the widget.
|
Mark M. |
the theory is you're not supposed to be reacting
to the soft keyboard coming and going
|
Mike R. |
That's a nice theory, but it's not very helpful.
|
Mark M. |
well, what are you doing when the user doesn't
have a soft keyboard?
|
Aug 10 | 8:20 PM |
Mike R. |
Haven't gotten that far yet. Trying to figure out
the soft keyboard scenario first.
|
Mark M. |
my point is that you're not supposed to be doing
anything in either case
|
Mike R. |
That's a nice theory, but I need to provide
guidance for the user to understand the requirements of the data entry
task they are doing.
|
Mark M. |
then provide the guidance, but don't try to play
games with the guidance based on the existence of a soft keyboard
|
Mark M. |
just have it always be there
|
Mark M. |
after all, people with physical keyboards aren't
going to magically not need the guidance
|
Mark M. |
for instance, use android:hint
|
Mike R. |
The view is too cluttered already and the
instructions could easily take up more than half of the view.
|
Mike R. |
already using hint
|
Mark M. |
then split it into multiple activities
|
Mark M. |
or a wizard
|
Mike R. |
for people with keyboards, I can detect the
EditText getting and losing focus
|
Aug 10 | 8:25 PM |
Mark M. |
I don't know how to help you
|
Mark M. |
Google (mostly Ms. Hackborn) has stated repeatedly
that you're not supposed to do what you're trying to do
|
Mark M. |
I personally know of no reliable workarounds
|
Mike R. |
argh!!!!!
|
Mike R. |
have to get my laptop for my other question. be
right back
|
Aug 10 | 8:30 PM |
Mike R. |
ok. On my main view, I use the system progress
bar to indicate the progress of some start up activities. Works great.
|
Mark M. |
"system progress bar" meaning the one in the title
bar?
|
Mike R. |
When the start-up activities have finished, I sent
position to 10000 which fills the progress bars, pauses for a few
seconds and then clears the progress bar. works great.
|
Mike R. |
yes. that's the one.
|
Mike R. |
Problem is, I have a secondary, user-initiated
activity for which I'd like to show progess.
|
Mike R. |
The first step in this activity sets the position
to 1000 (10%)
|
Mike R. |
The progress bar shows a deep yellow bar at 10%,
but a more faded yellow at about 50%.
|
Mike R. |
I've got an example I can email you.
|
Aug 10 | 8:35 PM |
Mark M. |
what's the question?
|
Mike R. |
How do I clear that faded yellow out of the
progress bar?
|
Mark M. |
don't set it to 50%, apparently
|
Mark M. |
is it that you want a different color, or that you
don't want 50%, or something else?
|
Mike R. |
I don't set it to 50%. I set it to 10%. The
screen shot should be in our email
|
Mark M. |
that's the secondary progress
|
Mike R. |
what's secondary progress?
|
Mark M. |
On a ProgressBar, there are two progress levels,
primary and secondary
|
Mark M. |
think "progress of copying the current file" and
"progress in copying the whole set of files"
|
Mark M. |
call setSecondaryProgress(0)
|
Mark M. |
and that should get rid of it
|
Gwindor | has entered the room |
Mike R. |
excellent. thanks.
|
Mark M. |
howdy, Gwindor
|
Mike R. |
that's all for me.
|
Mark M. |
ok
|
Mark M. |
Gwindor, do you have a question?
|
Aug 10 | 8:50 PM |
Gwindor | has left the room |
Aug 10 | 8:55 PM |
Mark M. |
OK, any last questions?
|
Aug 10 | 9:00 PM |
Mike R. | has left the room |
Mark M. | turned off guest access |