[android-developers] Mistake in official Sample ?

2010-11-08 Thread Omie
http://developer.android.com/resources/faq/commontasks.html#opennewscreen

Scroll down to Returning a Result from a Screen and look at code sample :

Shouldn't that be requestCode to switch() ?

// Listen for results.
protected void onActivityResult(int requestCode, int resultCode, Intent data){

// See which child activity is calling us back.
switch (*resultCode*) {

case CHOOSE_FIGHTER:
// This is the standard resultCode that is sent back if the

// activity crashed or didn't doesn't supply an explicit result.
if (resultCode == RESULT_CANCELED){

myMessageboxFunction(Fight cancelled);
}

else {
myFightFunction(data);

}
default:
break;

}
}

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

Re: [android-developers] PreferenceActivity preference OnClick and FolderBrowserDialog issue

2010-11-05 Thread Omie
Hi !

Thank you for the response.

[ if this is called as top-posting then I'm sorry for that, didnt get how to
write it in the fashion you replied, Q-A..Q-A.. way..]

well, I could not wait for long so I gave up on PreferenceActivity. I
created a simple activity and now handling their events.
So far working great, in exactly same way I wished it to be.
I worked on FileBrowser thing and have made it to show second screen as
well, including return value, which would return selected path.


I'll get back to the group if I have any more doubts.

Thank you for your time.


Thanks


On Fri, Nov 5, 2010 at 10:49 PM, TreKing treking...@gmail.com wrote:

 On Thu, Nov 4, 2010 at 11:24 AM, Omie intelom...@gmail.com wrote:

 I found these in documentation but not getting how to use it :

 http://developer.android.com/reference/android/preference/Preference.OnPreferenceChangeListener.html

 http://developer.android.com/reference/android/preference/Preference.OnPreferenceClickListener.html

 need help with this part..



 http://developer.android.com/reference/android/preference/Preference.html#setOnPreferenceChangeListener%28android.preference.Preference.OnPreferenceChangeListener%29




 2] is there any readymade thing equivalent to FolderBrowserDialog ?


 Nope.


  I wish to have a FolderBrowserDialog kind of thing as one of the
 preferences so that user can select directory my application can read some
 notes from.

 what is the correct way to achieve it ?


 Is this a place you're going to store data or are you letting the user
 import something you have no control over?


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

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

[android-developers] PreferenceActivity preference OnClick and FolderBrowserDialog issue

2010-11-04 Thread Omie

Hi !

Greetings to all :-)

I need help with 2 problems :

1] I'm working on a tiny alarm app [next step after Hello World]. It
doesn't require a special UI, only 2-3 settings are there[on/
off,interval,etc]. So I thought of making it PreferenceActivity
directly. Its okay, right ?
I added an xml file with 2 CheckboxPreferences for now and loading
that file in OnCreate using

addPreferencesFromResource(R.xml.preferences);

What I wish to do is, if first CheckboxPreference is clicked
[unchecked], unregister alarm.
else if its checked, re-register alarm.

but I am not getting how do I grab OnClick event for these Preferences
since they were added by addPreferencesFromResource.

I found these in documentation but not getting how to use it :
http://developer.android.com/reference/android/preference/Preference.OnPreferenceChangeListener.html
http://developer.android.com/reference/android/preference/Preference.OnPreferenceClickListener.html

need help with this part..

2] is there any readymade thing equivalent to FolderBrowserDialog ?
I wish to have a FolderBrowserDialog kind of thing as one of the
preferences so that user can select directory my application can read
some notes from.

what is the correct way to achieve it ?

If this is going to help you to help me : I'm an experienced c+
+,c#.net developer, know basics of java, yet to finish 24 hours with
Android :-)


Thanks

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