Sunday, August 21, 2011

[android-developers] Ideas about how I can start activity without flag activity new task

Ok,

First of all, I'll start out by saying I've done research and
understand why android prevents people from being able to do such
things, but its really preventing me from being able to build this
library as I'd like to. Likewise I'd appreciate people who feel the
overwhelming urge to quickly respond with: "...you are ruining user
experience..." or "...your not supposed to do that..." or "...everyone
will uninstall your app..." to kindly keep that advice to themselves.
I believe I have a perfectly legitimate case for what I want to do,
and the goal is by no means to provide a negative user experience.

1) The goal.
I'd like users to be able to simply include a reference to my library
and initialize it in onCreate of an application( that part is done,
and functions exactly like I'd like it to),
consumers of my library will call a number of commands... one of which
intentionally pops up some blocking ui of sorts requiring user input.
It does not need to popup if the app is in the background or
anything.... It's always gonna be the direct result of a call from the
app (eg,not popping up from a service on top of other apps etc).


2) What I've managed to make work
I have my app mostly working by having the user call
someclass.performLogic(this) where this is an activity. I pass the
activity through to the method that fires off logic, and if necessary
will use that activity to start a new intent with
flag_activity_new_task, and tell activity to .finish(). This is the
effect I'd like, however I'd really like to be able to not have to
have the consumers of my service to include this in the call.

3) 2 Ideas I had previously were

- try and figure out if i could from application context, get a list
of activities, and kill the top one (in which case I'd expect starting
the new activity with new task, and then killing the previous, I'd
effectively achieve what I am now.

- try and figure out a way to avoid that all together, and figure out
a clever way to get around the requirement for new_task.


I've dinked around with launch intent flags, but nothing really seemed
to fix the ability for the user to hit back and get the previous
pane.( because they were fired off in the root of a new activity
heirarchy, and likewise, back would just return you to the previous
heirarchy.).

Currently the stuff that launches, is in an activity, but there is
nothing that says it couldnt be a dialog (seems like theres some
potential to force a user to enter information in at least that app,
without blocking entire system, or providing negative user experience.


I'm just looking for some pointers at this point... I'd really like to
go out of my way to get something that least to the most pleasant
integration with other developers. if All they had to do was call
performLogic(actual relative parameters), and that was it, that would
be beautiful.


I appreciate any pointers or advice in advance.

Weston

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment