Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 04-03-2009, 09:17 AM   #1
Junior Member
 
Join Date: Apr 2009
Posts: 1
Friends: 0
View jdc3's Profile   View jdc3's Photo Album   View jdc3's Blog   View Social Groups
Hi,
I am new to Android so this maybe a stupid question but an answer would really help me.
I am developing a simple application that connects to a server. I need to run a while loop to receive the information from the server. I have a method called play() were the while loop is executed, play() is called in the onCreate(Bundle savedInstanceState) method. When I run the emulator the view for the page do not load. I believe this is because the while loop does not terminate and it cannot until I get some user interaction which I need the view for. How do I make the layout load and then run the play() method..

Here is code

java Code:
  1. @Override
  2. public void onCreate(Bundle savedInstanceState)
  3. {
  4.         super.onCreate(savedInstanceState);
  5.         setContentView(R.layout.texasholdem);
  6.         try
  7.         {
  8.              play()
  9.         }
  10.         else(Exception e)
  11.        {
  12.        }
  13. }
  14. private void play()
  15. {
  16.      boolean b = true
  17.      while(true)
  18.      {
  19.           ..............
  20.           ..............
  21.           if(msg.equals("end"))
  22.           {
  23.                 b = false;
  24.           }
  25.     }
  26. }
jdc3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Endless MySpace Mobile loop misspriss Android Games And Applications 3 02-06-2009 08:04 AM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.