[android-beginners] Re: OnClickListener in my ListView

2010-03-10 Thread SREEHARI
Use onListItemClick(ListView list, View view,int position, long id)

REgards,

SREEHARI

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: insatallation problem

2010-03-10 Thread Taruna Maddali
i tried doing that..it gives the same error..and tried with the http .

On Wed, Mar 10, 2010 at 1:23 PM, S.T. Hector CHANCOCO soloc...@gmail.comwrote:

 If I'm not wrong,
 The correct link should be : https://dl-ssl.google.com/android/eclipse
 https://dl-ssl.google.com/android/eclipse
 Pleas try this and let me know

 Regards

 Sent from my iPhone

 On Mar 10, 2010, at 8:37 AM, Taruna Maddali taruna.madd...@gmail.com
 wrote:

 hi again
 but when i directly go to the link from the browser ,the xml file opens.

 On Wed, Mar 10, 2010 at 12:58 PM, S.T. Hector CHANCOCO soloc...@gmail.com
 soloc...@gmail.com wrote:

 Hy,
 Please make sure your corporate firewall is not blocking the connection

 Regards

 Sent from my iPhone


 On Mar 10, 2010, at 8:25 AM, taru  taruna.madd...@gmail.com
 taruna.madd...@gmail.com wrote:

  want to add one more thing..i am working behind  a corporate proxy..


 On Mar 10, 11:48 am, taru taruna.madd...@gmail.com wrote:

 hi..
 I am on eclipse 3.5
 i am getting an error
 Failed to fetch 
 URLhttp://http://dl-ssl.google.com/android/repository/repository.xml
 dl-ssl.google.com/android/repository/repository.xml,
 reason: Connection refused: connect
 what do i do?


 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
  http://stackoverflow.com/questions/tagged/android
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
  android-beginners%2bunsubscr...@googlegroups.com
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en
 http://groups.google.com/group/android-beginners?hl=en


 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
  http://stackoverflow.com/questions/tagged/android
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
  android-beginners%2bunsubscr...@googlegroups.com
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en
 http://groups.google.com/group/android-beginners?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
  http://stackoverflow.com/questions/tagged/android
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
  android-beginners+unsubscr...@googlegroups.com
 android-beginners+unsubscr...@googlegroups.com
 For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en
 http://groups.google.com/group/android-beginners?hl=en

  --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: activitynotfound exception

2010-03-10 Thread SREEHARI

Inside onClick of Button u do the below steps

Intent intent = new Intent(this, MyPreferenceActivity.class);
startActivity(intent);


Regards,
SREEHARI

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: insatallation problem

2010-03-10 Thread Xavier Ducrohet
It's likely that your IT department configured your browser to go through
your corporate proxy.
Talk to them to figure out how to configure Eclipse to use your proxy (in
preferences under General Network connections)

Xav

On Tue, Mar 9, 2010 at 11:37 PM, Taruna Maddali taruna.madd...@gmail.comwrote:

 hi again
 but when i directly go to the link from the browser ,the xml file opens.


 On Wed, Mar 10, 2010 at 12:58 PM, S.T. Hector CHANCOCO soloc...@gmail.com
  wrote:

 Hy,
 Please make sure your corporate firewall is not blocking the connection

 Regards

 Sent from my iPhone


 On Mar 10, 2010, at 8:25 AM, taru taruna.madd...@gmail.com wrote:

  want to add one more thing..i am working behind  a corporate proxy..


 On Mar 10, 11:48 am, taru taruna.madd...@gmail.com wrote:

 hi..
 I am on eclipse 3.5
 i am getting an error
 Failed to fetch URLhttp://
 dl-ssl.google.com/android/repository/repository.xml,
 reason: Connection refused: connect
 what do i do?


 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en




-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Disable keyboard in DatePicker ?

2010-03-10 Thread djdamage06
Hello everybody,

Is it possible to disable the edition of fields in DatePicker ? Indeed
when I touch on the editable box in the DatePicker, the keyboard
appears... And I don't want this !

Someone have an idea ?


Thanks a lot for your response :)



Bonjour à tous,

Existe-t-il un moyen de désactiver l'édition (et donc l'apparition du
clavier) dans les champs d'un DatePicker ? En effet le fait que le
clavier apparaisse lorsqu'on décide de n'appuyer ni sur + ni sur -
mais directement dans le champ fait que ma layout est toute
bordélisée...

Certes je pourrais anticiper ce mouvement par une Scrollbar mais c'est
vraiment pas mon but...

Quelqu'un a une idée ?

Merci d'avance pour vos réponses smile

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: can we launch an activity from windowManagerService?

2010-03-10 Thread Gladys
Hi Justin,
The WindowManagerService itself had a context variable named mContext.
I used it to start an activity and It worked..

Thanks for the help.

On Mar 9, 6:30 am, Justin Anderson janderson@gmail.com wrote:
 If WindowManagerService inherits from Service then you shouldn't need to use
 getContext().  You should be able to just use the this pointer (either
 implicitly or explicitly).

 Unfortunately, I have no experience modifying the Android source and don't
 have access to that class via the SDK so I can't help out much.
 --
 There are only 10 types of people in the world...
 Those who know binary and those who don't.
 --

 On Mon, Mar 1, 2010 at 8:59 AM, Revathi K J Ramanan 

 revathiramana...@gmail.com wrote:
  HI Justin,

  I am modifying the android source code.

  The error i am encountering is

  cannot find symbol.
  startActivity(Intent)..

  Should i use getContext().startActivity(Intent)???
  I am trying this in dispatchKey() function in windowManagerService .

  Thanks in advance

  On Mon, Mar 1, 2010 at 7:32 PM, Justin Anderson 
  janderson@gmail.comwrote:

  What error are you getting?  What is the code you are using to launch the
  activity?  Is this for an SDK app or are you modifying and building the
  Android source?

  On Feb 28, 2010 9:35 PM, Gladys revathiramana...@gmail.com wrote:

  Hi,

  Does the startActivity() works when used inside windowManagerService
  function?

  I am trying to identify a keyPress Event and if it haooens i want to
  start an activity before allowing the code to go to ViewRoot part and
  the application's onKeyDown function.

  I am trying to use startActivity() from dispatchKey() in
  WindowManagerService.
  But it is ahowing me an error.

  Can some one help me out

  --
  You received this message because you are subscribed to the Google
  Groups Android Beginners g...

   --
  You received this message because you are subscribed to the Google
  Groups Android Beginners group.

  NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

  To unsubscribe from this group, send email to
  android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en

   --
  You received this message because you are subscribed to the Google
  Groups Android Beginners group.

  NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

  To unsubscribe from this group, send email to
  android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Vodafone distributes Mariposa botnet

2010-03-10 Thread Shawn Brown
How widespread is this?

How can I check on osx if my handset has the Mariposa bot, Confiker or
Lineage password stealing malware.  I'm probably safe running osx but
don't want to infect any windows machines I hook up to.

http://research.pandasecurity.com/vodafone-distributes-mariposa/

Maybe this is just an isolated incident?

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: OE 1.2.1 usb internet tethering does not work

2010-03-10 Thread Xi Shen
On Tue, Mar 9, 2010 at 9:35 PM, Lonestarr13 lonestar...@gmail.com wrote:
 You upgraded to openeclair? I'm not sure about 1.2.1 but I'm running
 1.2.2 and this is a known issue that will be fixed in next release.


you mean i cannot use internet tethering on OE 1.2.2? good luck, i did
not upgrade :)


-- 
Best Regards,
David Shen

http://twitter.com/davidshen84/

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] add text to a drawable? (maps question)

2010-03-10 Thread Michael Dorin
I am doing a map application and would like to put more than just a
'star' or a 'pin' on the map when it is selected.
Is it possible to make a drawable icon, and shove some text into it?
That way I could have a bit of info and the location tagged.

Thanks,
  Mike

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] add text to a drawable? (maps question)

2010-03-10 Thread Mark Murphy
Michael Dorin wrote:
 I am doing a map application and would like to put more than just a
 'star' or a 'pin' on the map when it is selected.
 Is it possible to make a drawable icon, and shove some text into it?
 That way I could have a bit of info and the location tagged.

You can certainly have different Drawables per pin at runtime:

http://github.com/commonsguy/cw-advandroid/tree/master/Maps/ILuvNooYawk/

I haven't tried creating a custom Drawable, rendered from a Canvas or
something, so I don't know much about that aspect.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] App running on dev phone creates a log??

2010-03-10 Thread BobG
Is there a log file on the phone? Someone tell me how to look at it?
Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] App running on dev phone creates a log??

2010-03-10 Thread Mark Murphy
BobG wrote:
 Is there a log file on the phone? Someone tell me how to look at it?

adb logcat, DDMS, or the DDMS perspective in Eclipse, with the device
connected to the computer via the USB cable.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Online Training: 26-30 April 2010: http://onlc.com

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Internet Download Manager 5.18.7 | 6.1 Mb

2010-03-10 Thread soso essa
Internet Download Manager 5.18.7 | 6.1 Mb

http://alagmysoft.blogspot.com/2010/03/internet-download-manager-5187.html

16 Download Managers in 1 Pack | 54 MB
http://alagmysoft.blogspot.com/2010/03/16-download-managers-in-1-pack.html

YouTubeGet 5.4 | 5 Mb
http://alagmysoft.blogspot.com/2010/03/youtubeget-54.html

Megaupload Direct Download Trick | 5.46mb
http://alagmysoft.blogspot.com/2010/03/megaupload-direct-download-trick.html

for more download programs just visit our blogger
http://alagmysoft.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: App running on dev phone creates a log??

2010-03-10 Thread BobG
Yo Da Man Mark! Hope I don't use up all my question tickets before I
get into the hard ones...

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] activitynotfound exception

2010-03-10 Thread Yousuf Faheem
Hi

check the package name that your activity has and the package name the
manifest file has.
Also check what package name you are giving in your intent.


Thanks  Regards,
Yousuf Syed
773-719-4786



On Tue, Mar 9, 2010 at 1:23 AM, cnbishop cnbis...@gmail.com wrote:

 hi, i am trying to implement this tutorial i found online:

 http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html

 i keep getting an error that the activity isn't found when i try to
 implement this intent.

 i have a button and when it is clicked it calls my
 MyPreferenceActivity

 Button Settings_Button = (Button) findViewById(R.id.Settings_Button);
Settings_Button.setOnClickListener(settingsListener);

 that is when it throws the error.  however i have defined the activity
 in my manifest file:

 activity android:name=.MyPreferenceActivity
  android:label=@string/app_name
/activity

 am i missing something? i tried renaming it. or defining it like so:
 com.package.MyPreferenceActivity

 no luck.  any help is appreciated.

 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Snake Demo Question

2010-03-10 Thread Mike

Thanks for the response!  Takes about 3 weeks to get a post and
response on here! Wow

I am really just getting up to speed on formatting issuecrawling
right now.
I'm a noob, so this may seem obvious to veterans but...after digging a
little deeper into the demo, I found this;

 /**
 * Draws some apples.
 *
 */
private void updateApples() {
for (Coordinate c : mAppleList) {
setTile(YELLOW_STAR, c.x, c.y);
}

And

map.putIntArray(mAppleList, coordArrayListToArray(mAppleList));

And cross referencing with the developers documentation;

Normally, Lists allow duplicate elements, as compared to Sets, where
elements have to be unique. 

So, it looks like the answer to my question is that nothing is
preventing the second apple being drawn over the first. Unless I am
missing something here





On Mar 8, 7:52 pm, Justin Anderson janderson@gmail.com wrote:
 Sure, just write some simple code that makes sure newCoord is not already in
 mAppleList...  put it right after the check for colliding with the snake
 location.

 --
 There are only 10 types of people in the world...
 Those who know binary and those who don't.
 --

 On Fri, Feb 26, 2010 at 1:40 PM, Mike baronbo...@gmail.com wrote:

  My first post here...hello!

  Can anyone tell me what is to prevent the Snake demo from putting 2
  apples in the same location?
  When the game starts, it populates 2 apples.

  Here is the relevant method;

  private void addRandomApple() {
         Coordinate newCoord = null;
         boolean found = false;
         while (!found) {
             // Choose a new location for our apple
             int newX = 1 + RNG.nextInt(mXTileCount - 2);
             int newY = 1 + RNG.nextInt(mYTileCount - 2);
             newCoord = new Coordinate(newX, newY);

             // Make sure it's not already under the snake
             boolean collision = false;
             int snakelength = mSnakeTrail.size();
             for (int index = 0; index  snakelength; index++) {
                 if (mSnakeTrail.get(index).equals(newCoord)) {
                     collision = true;
                 }
             }
             // if we're here and there's been no collision, then we
  have
             // a good location for an apple. Otherwise, we'll circle
  back
             // and try again
             found = !collision;
         }
         if (newCoord == null) {
             Log.e(TAG, Somehow ended up with a null newCoord!);
         }
         mAppleList.add(newCoord);
     }

  --
  You received this message because you are subscribed to the Google
  Groups Android Beginners group.

  NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

  To unsubscribe from this group, send email to
  android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Snake Demo Question

2010-03-10 Thread Justin Anderson
* Thanks for the response!  Takes about 3 weeks to get a post and response
on here! Wow*

It was 10 days... about a week and a half.  And all of us are reading
through these posts and answering on our own personal time.

* So, it looks like the answer to my question is that nothing is preventing
the second apple being drawn over the first. Unless I am missing something
here*

Yes... and I misunderstood your original question.  I was telling you
where/how to add the code to put that check in.

Good luck with Android!  It's a great platform...

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Wed, Mar 10, 2010 at 1:39 PM, Mike baronbo...@gmail.com wrote:


 Thanks for the response!  Takes about 3 weeks to get a post and
 response on here! Wow

 I am really just getting up to speed on formatting issuecrawling
 right now.
 I'm a noob, so this may seem obvious to veterans but...after digging a
 little deeper into the demo, I found this;

  /**
 * Draws some apples.
 *
 */
private void updateApples() {
for (Coordinate c : mAppleList) {
setTile(YELLOW_STAR, c.x, c.y);
}

 And

 map.putIntArray(mAppleList, coordArrayListToArray(mAppleList));

 And cross referencing with the developers documentation;

 Normally, Lists allow duplicate elements, as compared to Sets, where
 elements have to be unique. 

 So, it looks like the answer to my question is that nothing is
 preventing the second apple being drawn over the first. Unless I am
 missing something here





 On Mar 8, 7:52 pm, Justin Anderson janderson@gmail.com wrote:
  Sure, just write some simple code that makes sure newCoord is not already
 in
  mAppleList...  put it right after the check for colliding with the snake
  location.
 
  --
  There are only 10 types of people in the world...
  Those who know binary and those who don't.
  --
 
  On Fri, Feb 26, 2010 at 1:40 PM, Mike baronbo...@gmail.com wrote:
 
   My first post here...hello!
 
   Can anyone tell me what is to prevent the Snake demo from putting 2
   apples in the same location?
   When the game starts, it populates 2 apples.
 
   Here is the relevant method;
 
   private void addRandomApple() {
  Coordinate newCoord = null;
  boolean found = false;
  while (!found) {
  // Choose a new location for our apple
  int newX = 1 + RNG.nextInt(mXTileCount - 2);
  int newY = 1 + RNG.nextInt(mYTileCount - 2);
  newCoord = new Coordinate(newX, newY);
 
  // Make sure it's not already under the snake
  boolean collision = false;
  int snakelength = mSnakeTrail.size();
  for (int index = 0; index  snakelength; index++) {
  if (mSnakeTrail.get(index).equals(newCoord)) {
  collision = true;
  }
  }
  // if we're here and there's been no collision, then we
   have
  // a good location for an apple. Otherwise, we'll circle
   back
  // and try again
  found = !collision;
  }
  if (newCoord == null) {
  Log.e(TAG, Somehow ended up with a null newCoord!);
  }
  mAppleList.add(newCoord);
  }
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Beginners group.
 
   NEW! Try asking and tagging your question on Stack Overflow at
  http://stackoverflow.com/questions/tagged/android
 
   To unsubscribe from this group, send email to
   android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 android-beginners%2bunsubscr...@googlegroups.comandroid-beginners%252bunsubscr...@googlegroups.com
 
   For more options, visit this group at
  http://groups.google.com/group/android-beginners?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this 

[android-beginners] Context menu from button

2010-03-10 Thread Sonic
Hi All,

How do I create a custom context menu for a button widget? So that
when you press and hold on a button, it displays a custom context
menu?

Thank you.

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Context menu from button

2010-03-10 Thread Mark Murphy
Sonic wrote:
 How do I create a custom context menu for a button widget? So that
 when you press and hold on a button, it displays a custom context
 menu?

Step #1: Call registerForContextMenu() on your Activity to say what
widget needs the menu

Step #2: Implement onCreateContextMenu() in your Activity to define the menu

Step #3: Implement onContextItemSelected() in your Activity to get
control on a menu choice

http://github.com/commonsguy/cw-android/tree/master/Database/Constants/

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android 2.0 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Populate ListView inside a Activity

2010-03-10 Thread Kitzy
Search for how to fill an ArrayAdapter with an xml file, there are
also examples which come with the sdk examples. You should create an
array file in your res/values directory and you will have to have all
the contries you want lited in it.

-Kitzy

On Mar 7, 12:46 pm, plexus andersthu...@gmail.com wrote:
 How can I populate array COUNTRIES to the ListView list   @+id/
 lKompListe ?

 =
 XML
 =
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
         android:orientation=vertical android:layout_width=fill_parent
         android:layout_height=fill_parent

         LinearLayout android:id=@+id/LinearLayout01
                 android:layout_height=wrap_content
 android:layout_width=fill_parent
                 Button android:layout_width=wrap_content
                         android:layout_height=wrap_content android:id=@+id/
 buttonTilbake
                         android:text=Tilbake/Button
                 TextView android:layout_width=wrap_content
                         android:layout_height=wrap_content 
 android:id=@+id/textTittel
                         android:layout_weight=1 android:textSize=18dp
 android:textStyle=bold
                         android:layout_gravity=center 
 android:gravity=center
                         android:text=Velg komponent/TextView
                 Button android:id=@+id/Button01
 android:layout_width=wrap_content
                         android:layout_height=wrap_content 
 android:text=Endre
                         android:visibility=invisible/Button
         /LinearLayout
         ListView android:layout_width=wrap_content
                 android:layout_height=wrap_content android:layout_weight=1
                 android:id=@+id/lKompListe/ListView
 /LinearLayout

 =
 JAVA
 =
 public class VelgKomponent extends Activity {
         Button tilbake;
         Intent intent;
         ListView list;

         static final String[] COUNTRIES = new String[] { Afghanistan,
 Albania,
                         Algeria, American Samoa };

         @Override
         public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 setContentView(R.layout.velgkomp);

                 tilbake = (Button) findViewById(R.id.buttonTilbake);

                 View.OnClickListener handler = (new View.OnClickListener() {

                         @Override
                         public void onClick(View v) {
                                 switch (v.getId()) {
                                 case R.id.buttonTilbake: // doStuff
                                         intent = new Intent(v.getContext(), 
 ShoppingBasket.class);
                                         startActivity(intent);
                                         break;
                                 }
                         }
                 });

                 findViewById(R.id.buttonTilbake).setOnClickListener(handler);
                 list = (ListView) findViewById(R.id.lKompListe);}

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Spinner not displaying the selectedItem

2010-03-10 Thread -DC-
I'm using a Spinner view to display a list of items (file names) and
frequently refreshing it with new data. I've ran into a situation
where the item being displayed in the view is not the item actually
selected. This happens after programatically calling setSelection(). I
started wondering if maybe it was a refresh problem for the view, but
calling invalidate() and postInvalidate() did not accomplish anything.
Can someone help me out?

-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Populate ListView inside a Activity

2010-03-10 Thread kavitha
  create an ArrayAdapter and add list items to it.

then use list.setAdapter(adapter);


On Thu, Mar 11, 2010 at 5:22 AM, Kitzy kitzyk...@gmail.com wrote:

 Search for how to fill an ArrayAdapter with an xml file, there are
 also examples which come with the sdk examples. You should create an
 array file in your res/values directory and you will have to have all
 the contries you want lited in it.

 -Kitzy

 On Mar 7, 12:46 pm, plexus andersthu...@gmail.com wrote:
  How can I populate array COUNTRIES to the ListView list   @+id/
  lKompListe ?
 
  =
  XML
  =
  ?xml version=1.0 encoding=utf-8?
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
  android:orientation=vertical android:layout_width=fill_parent
  android:layout_height=fill_parent
 
  LinearLayout android:id=@+id/LinearLayout01
  android:layout_height=wrap_content
  android:layout_width=fill_parent
  Button android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:id=@+id/
  buttonTilbake
  android:text=Tilbake/Button
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:id=@+id/textTittel
  android:layout_weight=1 android:textSize=18dp
  android:textStyle=bold
  android:layout_gravity=center
 android:gravity=center
  android:text=Velg komponent/TextView
  Button android:id=@+id/Button01
  android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:text=Endre
  android:visibility=invisible/Button
  /LinearLayout
  ListView android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:layout_weight=1
  android:id=@+id/lKompListe/ListView
  /LinearLayout
 
  =
  JAVA
  =
  public class VelgKomponent extends Activity {
  Button tilbake;
  Intent intent;
  ListView list;
 
  static final String[] COUNTRIES = new String[] { Afghanistan,
  Albania,
  Algeria, American Samoa };
 
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.velgkomp);
 
  tilbake = (Button) findViewById(R.id.buttonTilbake);
 
  View.OnClickListener handler = (new
 View.OnClickListener() {
 
  @Override
  public void onClick(View v) {
  switch (v.getId()) {
  case R.id.buttonTilbake: // doStuff
  intent = new
 Intent(v.getContext(), ShoppingBasket.class);
  startActivity(intent);
  break;
  }
  }
  });
 
 
 findViewById(R.id.buttonTilbake).setOnClickListener(handler);
  list = (ListView) findViewById(R.id.lKompListe);}

 --
 You received this message because you are subscribed to the Google
 Groups Android Beginners group.

 NEW! Try asking and tagging your question on Stack Overflow at
 http://stackoverflow.com/questions/tagged/android

 To unsubscribe from this group, send email to
 android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-beginners?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Beginners group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en