Mar 28 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Carlos | has entered the room |
Mark M. |
hello, Carlos!
|
Mark M. |
how can I help you today?
|
Carlos |
Hi Mark!
|
Dmitri P. | has entered the room |
Mark M. |
hello, Dmitri!
|
Carlos |
Based on your feedback I started implementing the AlarmManager intent through a ScheduledService (similar to your example).
|
Carlos |
I added notifications using the NotificationCompat library and I'm able to open activity with intent's data.
|
Dmitri P. |
Hello Mark!
|
Dmitri P. |
I have a question regarding the size of a canvas - see http://stackoverflow.com/questions/15680744/siz... .
|
Carlos |
The problem that I'm facing is that if the user
presses a button from the action bar, the activity gets dismissed
instead of going to main activity
|
Carlos |
However, if I press the up navigation button from the loaded activity is does go to the main activity.
|
Ron B. | has entered the room |
Carlos |
Could this be something related to the flags for the intent?
|
Carlos |
This is my sendReminder method:
|
Carlos |
View paste
(1 more line)
|
Mar 28 | 4:00 PM |
Mark M. |
that's an AlarmManager schedule, not an action bar
|
Peri H. | has entered the room |
Peri H. |
Hi Mark, I'm back!
|
Mark M. |
Dmitri: I have done little in this area, but
onSizeChanged() has worked where I needed it -- not sure why it would
not be working for you
|
Mark M. |
(Ron, Peri: hello! I will be with you shortly)
|
Carlos |
So during normal app operation the action bar
buttons operate properly. The problem is when the activity is loaded
after pressing the notification icon.
|
Mark M. |
Carlos: my guess is that you are getting twisted up with different tasks
|
Dmitri P. |
Mark, are there any specialties related to fragments?
|
Mark M. |
Dmitri: not in terms of the sizes of widgets
|
Dmitri P. |
OK, thanks.
|
Mark M. |
Carlos: can you show your code for the PendingIntent you are using with the Notification?
|
Dmitri P. |
Good bye.
|
Carlos |
Mark, sorry. I was sure if the issue is in the
intent to AlarmManager, or with the intent received in the
onHandleIntent of the IntentService
|
Dmitri P. | has left the room |
Mar 28 | 4:05 PM |
Carlos |
This is my notification code:
|
Carlos |
View paste
(36 more lines)
|
Mark M. |
I have not worked with TaskStackBuilder, because the very concept makes me angry
|
Carlos |
Hehehe. Might I know why?
|
Mark M. |
I don't like lying to users
|
Mark M. | |
Mark M. |
anyway, you might consider running a test with a
more conventional PendingIntent and see how that works with your action
bar items
|
Mark M. |
let me take questions from the others, and I will be back with you shortly
|
Carlos |
So the way you normally do it. How do you handle the notifications for both pre-11 and post-11 levels?
|
Mark M. |
Ron: do you have a question
|
Ron B. |
Hi Mark
|
Ron B. |
I'm trying to dynamically update the text in a
button (view.setText()). If the text is too large, Android simply cuts
it off. I'm using wrap_content for the width. Is there any way to set
the button or the text to automatically adjust it's size? I'm
implementing I18N so I have no way of predicting how long the strings
will be.
|
Mark M. |
the button should automatically resize, within whatever other constraints are placed upon it
|
Ron B. |
Do I need any constraints other than wrap_content?
|
Mark M. |
I have no idea
|
Mark M. |
it's your UI, not mind
|
Mark M. |
er, mine
|
Mark M. |
but if the size of its container is constrained, the button cannot grow bigger than its container, etc.
|
Mark M. |
an alternative approach is to change the font size of the text, as the AutoScale TextView does: http://www.androidviews.net/2012/12/autoscale-t...
|
Mar 28 | 4:10 PM |
Mark M. |
presumably, you could create an AutoScale Button based on the same concept
|
Mar 28 | 4:10 PM |
Mark M. |
but you may just want to start with Hierarchy View to figure out why your button is not getting any bigger
|
Ron B. |
I tried it with or without "weight", without weight it was too large for the small strings.
|
Mark M. |
weight is used to address under-allocation or over-allocation of space in a LinearLayout
|
Mark M. |
again, I recommend that you use Hierarchy View to
get a better grip on what your LinearLayout is doing and therefore why
your button is not getting as big as you think it should
|
Mark M. |
let me take questions from the others, and I will be back with you shortly
|
Mark M. |
Peri: do you have a question?
|
Peri H. |
Hi
|
Peri H. |
Yes, I discovered a new "feature" of android.
When you use getAccounts() to get a list of accounts for contacts, it
returns duplicates.
|
Peri H. |
Not exactly duplicates as the types are different.
|
Mar 28 | 4:15 PM |
Peri H. |
Anyway, I'm trying to figure out which ones are really valid accounts for creating contacts.
|
Mar 28 | 4:15 PM |
Peri H. |
I dug into the source for the android contacts editor and it appears that they select based on which accounts are writable.
|
Peri H. |
From there I've gotten lost in a myriad of huge coe.
|
Peri H. |
code.
|
Peri H. |
I should add that AccountManger.getAccounts() does not return more than the account name and type (nothing about writable, etc)
|
Mark M. |
I am not sure what to tell you, other than you already know much more about this stuff than I do
|
Mark M. |
in particular, you have not really asked a question
|
Peri H. |
Should I be flattered or disappointed? Ha ha.
|
Mark M. |
definitely disappointed
|
Peri H. |
Well, it was meant to be a question: I'm not sure
how to tell whether the account is writable and, thus, usable for
creating contacts.
|
Mark M. |
beats me
|
Mark M. |
sorry
|
Peri H. |
Are there any ways, besides bounty on stackoverflow, to get more attention from the appropriate android team?
|
Mark M. |
steal a conference ticket to I|O
|
Mark M. |
note: this may be illegal in some jurisdictions
|
Peri H. |
It's kind of their fault - no documentation and the implication that getAccounts() gives you what you need. Clearly it doesn't.
|
Peri H. |
Ok, and I can break into the android lunchroom and stand on a table, too. :)
|
Mar 28 | 4:20 PM |
Mark M. |
you're welcome to try the android-developers Google Group as well
|
Mark M. |
let me swing back through the others, and I'll return to you in a bit
|
Mark M. |
Carlos: do you have another question?
|
Peri H. |
Ok, why not. Thanks.
|
Carlos |
Yes Mark.
|
Carlos |
I guess since you dislike Notification Builder.
How would I go about supporting notifications for both Gingerbread
devices as well as API11 and above
|
Mark M. |
I have no problems at all with Notification.Builder
|
Carlos |
Is there a similar example in your book?
|
Mark M. |
I have problems with TaskStackBuilder
|
Carlos |
ooops
|
Peri H. | has left the room |
Mark M. |
Notification.Builder (or, more accurately, NotificationCompat.Builder) is used for all the Notification samples in the book
|
Carlos |
so instead of TaskStackBuilder you just use a regular intent?
|
Mark M. |
PendingIntent, yes
|
Carlos |
yep, yep.
|
Carlos |
I read your blog post. If I understood correctly
you are saying that when a user presses on a notification to view the
items related to that notification, pressing the back button should move
the user's UI to whatever previous state they were before pressing the
notification icon. As opposed to Google's recommendation which is to go
to the root activity of the app for which I press the notification icon.
Did I understood correctly?
|
Mark M. |
no
|
Mark M. |
there is the BACK button, and there is the home affordance in the action bar
|
Mark M. |
they are not the same
|
Mar 28 | 4:25 PM |
Carlos |
I understand that Mark. I guess the guidelines are a little confusing regarding back operation.
|
Mark M. |
yes, to me too
|
Mark M. |
I haven't read through this in ages
|
Mark M. |
just now re-reading that blog post
|
Mark M. |
it's possible that the blog post is somewhat out of date relative to the design guidelines
|
Carlos |
If I clicked on a notification and it opens my
app. I understand that "up navigation" should go to root activity and
pressing an AB item should work as normally (i.e. AB item done should
process item edits and return to home activity). But still a bit
confused on what should back button do if user does not press an AB item
or the up navigation.
|
Mark M. |
that depends on who you ask
|
Mark M. |
if you ask Google, it goes somewhere the user has never been, via TaskStackBuilder or equivalent settings in the manifest
|
Mark M. |
if you ask me and many other developers, it goes to whatever screen the user had been on before
|
Mark M. |
while I generally advocate sticking with Google's design guidelines, this is one area where I do not
|
Mark M. |
however, my original point was: see if
TaskStackBuilder is what is causing the interference with how your
action bar items are working
|
Carlos |
yep. What you say makes sense. But it looks like
most apps are following design guidelines. Most non-Google apps I use go
to another screen within that app with the notification instead of
going to previous state.
|
Carlos |
Ok Mark. Sounds good. Thanks for your time.
|
Mark M. |
Ron: do you have another question?
|
Mar 28 | 4:30 PM |
Carlos | has left the room |
Ron B. |
I'm all set for now. Thanks.
|
Mark M. |
OK, if you come up with another question, chime in
|
Ron B. | has left the room |
Mar 28 | 4:55 PM |
Mark M. | turned off guest access |