[android-developers] Re: Clear defaults programmatically

2010-05-28 Thread Bonifaz
Is it even possible?
No one knows this?

I suppose many users don't know how to do this on their phones,
because it is rather complicated to understand for non programmers.
I want to give my users the option to clear defaults of my app, within
my app.

But how do I do this?

On Apr 19, 3:01 am, Bonifaz bonifaz.kaufm...@gmail.com wrote:
 This clears the preferences, but not the default flag set by a user
 when a Intent Chooser is shown to him/her.
 Am I right?

 How can I get back the Intent Chooser Dialog when a user previously
 set my app as default. I know you can go to Manage Applications and
 click clear defaults but how do I do this in code?

 On Apr 18, 3:01 pm, Menion menion.as...@gmail.com wrote:





  I'm using this code ... hope it helps

  PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commi 
  t();

  On Apr 16, 11:09 am,Bonifazbonifaz.kaufm...@gmail.com wrote:

   Does anyone know
   how to clear defaults of my own app by code.

   I know that a user can always go to Manage Applications, find my app
   and click the button there to clear previously assigned default
   actions. But for most users this isn't intuitive at all.

   I would like to offer my customers a solution to clear defaults within
   my own app if they don't like to use my app as a replacement for a
   specific action anymore.

   --
   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 
   athttp://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 
  athttp://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 
 athttp://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


[android-developers] Re: Clear defaults programmatically

2010-05-28 Thread Bonifaz
Thanks TreKing,

this is exactly what I meant. And thank you for your tip. I already
have a description of how to do this manually, but never thought about
opening the manage application activity. If there is no other way I
will head for your proposed work around.


On May 28, 8:37 pm, TreKing treking...@gmail.com wrote:
 On Fri, May 28, 2010 at 1:17 PM, skink psk...@gmail.com wrote:

 http://developer.android.com/intl/fr/reference/android/preference/Pre..., 
 int,
  boolean)

 This is not what the OP is asking - when you execute an action, if there are
 multiple activities that support that action you can choose which to use and
 optionally set it as the default handler of that action.

 For example, if you have two browsers and click a link, you can choose which
 to use and set one as the default so it's always called instead of giving
 you the choice. However, if you later decide you no longer want that
 activity to handle that action by default, you have to go through the
 preferences, select the app that is the default for that action, and hit a
 button to clear it as the default handler for that action.

 The OP wants to know if there is a way to programmatically do the equivalent
 of going through those steps.

 This has nothing to do with an app's own preferences.

 OP - I don't know if this is possible, but as a next best thing you could
 possibly tell the user what they have to do and then open the manage
 application's settings page for them and let them finish the process.

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://sites.google.com/site/rezmobileapps/treking

-- 
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


[android-developers] Re: Clear defaults programmatically

2010-04-18 Thread Menion
I'm using this code ... hope it helps

PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit();

On Apr 16, 11:09 am, Bonifaz bonifaz.kaufm...@gmail.com wrote:
 Does anyone know
 how to clear defaults of my own app by code.

 I know that a user can always go to Manage Applications, find my app
 and click the button there to clear previously assigned default
 actions. But for most users this isn't intuitive at all.

 I would like to offer my customers a solution to clear defaults within
 my own app if they don't like to use my app as a replacement for a
 specific action anymore.

 --
 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 
 athttp://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


[android-developers] Re: Clear defaults programmatically

2010-04-18 Thread Bonifaz
This clears the preferences, but not the default flag set by a user
when a Intent Chooser is shown to him/her.
Am I right?

How can I get back the Intent Chooser Dialog when a user previously
set my app as default. I know you can go to Manage Applications and
click clear defaults but how do I do this in code?

On Apr 18, 3:01 pm, Menion menion.as...@gmail.com wrote:
 I'm using this code ... hope it helps

 PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commi 
 t();

 On Apr 16, 11:09 am,Bonifazbonifaz.kaufm...@gmail.com wrote:





  Does anyone know
  how to clear defaults of my own app by code.

  I know that a user can always go to Manage Applications, find my app
  and click the button there to clear previously assigned default
  actions. But for most users this isn't intuitive at all.

  I would like to offer my customers a solution to clear defaults within
  my own app if they don't like to use my app as a replacement for a
  specific action anymore.

  --
  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 
  athttp://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 
 athttp://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