0

I've been searching and I couldn't find a topic that could clarify me 100%.

My question is: How can I launch an android's app preferences activity (from Contacts, Messages, ...) on my own app?

I give an example: Imagine I'm developing an app which allows the user to quickly access to Message's Settings. I don't need to send or receive any information, I only need to open the activity, create a shortcut for it.

Sergio Carneiro
  • 3,726
  • 4
  • 35
  • 51

3 Answers3

1

The best answer in this thread has the solution: android: how do i open another app from my app?

Also check: http://android-developers.blogspot.com/2009/01/can-i-use-this-intent.html

To open settings, you can try: startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS, 0));

Community
  • 1
  • 1
almalkawi
  • 1,108
  • 1
  • 11
  • 17
  • I think this doesn't solved my problem. I saw the link you gave me and @Tym Kryger says to use an intent and set `intent.setDataAndType(path, "application/pdf");` but I searched the Uri availables for the `path` using his link http://developer.android.com/guide/appendix/g-app-intents.html and it only gives me the Uri to Browser, Google Maps and Dialer ... – Sergio Carneiro Jul 31 '12 at 00:03
1

Someone knows if this can be done and even opening specific locations of the apps?

You don't need to know any specific locations or specific apps for these actions, simply look into Intent.ACTION_PICK.

Community
  • 1
  • 1
Sam
  • 86,580
  • 20
  • 181
  • 179
  • I don't want to pick something from an app, I want to open it. Actually I want to open its settings activity. I don't need to send or receive any info, I only want to open it. – Sergio Carneiro Jul 30 '12 at 23:47
  • It isn't the general settings that I want to open, it's Message's settings, Browser's settings, ... Settings from a specific android's app. I've read about opening other app's settings and it says I can't do it, but I'm not convinced, it has to be a way to open other app's activity. * I see i wasn't very clear in what I asked, I will update my question – Sergio Carneiro Jul 31 '12 at 00:09
1

There is no difference in writing in code an Explicit Intent which will go to a specific activity of your app and using the same format to go to a specific activity some other app. A few things to be aware of: (1) The receiving activity may be expecting particular data and fail otherwise. (2) The standard apps you are considering like Contacts, Messages while you can find the source for them in the Android Open Source Project (AOSP) may be changed by the manufacturers so that the activity names and necessary extra data could be different.

In order to maintain as much compatibility between all of the different Android manufacturers, you should stick to the standard implicit intent with the appropriate action/data.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • And all the platform apps can be accessed? I saw the source code of browser app (https://github.com/android/platform_packages_apps_browser/tree/master/src/com/android/browser) and i can't find those packages on eclipse while I'm coding. There's other way to access it? Do I have to download and connect it to my project or something like that? – Sergio Carneiro Aug 01 '12 at 21:08
  • The SDK plugin for Eclipse will only show those packages that are a part of the standard Java based APIs. There are other ways to get deeper but presume you are trying to build your own ROM/platform. Not sure how this relates to your original question. – Morrison Chang Aug 01 '12 at 22:13
  • I don't want my own platform, I only want to open some activities from android's standard apps and to do it I need to know where the activity is. That's all – Sergio Carneiro Aug 01 '12 at 22:26
  • The URL you listed has the apps (i.e. https://github.com/android/platform_packages_apps_contacts/tree/gingerbread-mr4-release) just be aware that the 'stock' apps can change between OS versions. If you want to look at source while you debug, you'll have to download and set the source path in eclipse. – Morrison Chang Aug 01 '12 at 23:14