• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Launching an Activity from Preferences.

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a PreferenceActivity Class that has the following code.


Using this code, I am able to start MyActivity.

I want to know how to do this declaratively from the XML file inside PreferenceScreen tag. How to do it without writing code, there must be some way.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

How to do it without writing code, there must be some way.


Why? The usual flow is to return to the previous activity after the preferences are done with. Starting some other activity is hardly a common use case.
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, here is the use case.

I have a preferences screen that has an option, which I click will list all the contacts.So this has to be done in an Activity I guess.

Also, in Google API Demos, there is an example that starts an activity from Preferences and that also declaratively using XML. The problem is, it is starting a browser that opens up www.android.com.

I want a declarative example how to declare intent tag that will be able to launch a normal Activity class.

Waiting for your response.

Thanks
 
Greenhorn
Posts: 4
Android Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


this is the example from that docs that you are referring to.


to start your activity you can do something like this


and you set an intent filter for that action
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic