OK. I'll be explain my needs: I'm the author of AnySoftKeyboard (http:// softkeyboard.googlecode.com). The reason I made this keyboard, is to provide alternative layouts in the on-screen keyboard (e.g., Hebrew, Russian, DVORAK, etc. and of course, qwerty). But the keyboard APK gets bloated with all the layouts, and dictionaries etc.... So, I wanted to move all layouts to external packages: one layout (or several) per package.
All the data I need to create a layout are the resource IDs of the layout, the dictionary and several other stuff, all of which can be retrieved using a ContentProvider. But I need the ContentProvider's URI. So I thought that starting an Activity and getting a result from it (startActivityForResult call) will be perfect for me. I do not need any UI to popuup (actually, I prefer that none will), I get need to get some data from the external package. So, these are my needs. Anyone can suggest a way? Thanks, Menny On Feb 12, 10:35 am, Kevin Duffey <andjar...@gmail.com> wrote: > The whole purpose of a service is to stay in the background doing something, > so not sure why you would want to display a UI in a non-UI based app. As > Dianne said, post a notification that shows up on the status bar... when the > user slides it down and clicks on it, that can launch an activity... which > can then bind to the service to pass it info if need be. I'd still argue > that would not be a good idea either. Can you elaborate on why you need some > user interaction with your service.. is it something that can't be, perhaps > set in a user preferences within an activity that the user launches the > first time (or later to change settings)? > > On Thu, Feb 11, 2010 at 7:53 PM, Dianne Hackborn <hack...@android.com>wrote: > > > You can't do this, nor should you. This would pop your UI in front of the > > user, disrupting whatever they are doing. This is highly discouraged. The > > proper way to do this is to post a notification, which the user can respond > > to when desired and can cause your own activity to be launched, which can > > then launch the other activity. > > > On Thu, Feb 11, 2010 at 11:17 AM, Menny <menn...@gmail.com> wrote: > > >> Hi, > >> I have a Service which needs to receive data from external packages. > >> So, to locate the data providing external packages, I use activity- > >> filter and PackageManager.queryIntentActivities function to locate the > >> interesting packages. > >> Now, from each such package, I need to get a ContentProvider URI. > >> So I want to start the external Activity and the external activity > >> will return a result to my service - something like > >> "startActivityForResult". > >> The problem is that there is no way to call "startActivityForResult" > >> from a Service, only Activity can do that, and my project does not > >> have any Activity, and probably can't show UI for the user. > > >> The bottom line: > >> Can anyone suggest a way to get ContentProvider URI from an external > >> package, while my package has only a Service? > > >> Thanks, > >> Menny. > > >> -- > >> 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > >> For more options, visit this group at > >>http://groups.google.com/group/android-developers?hl=en > > > -- > > Dianne Hackborn > > Android framework engineer > > hack...@android.com > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them. > > > -- > > 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en