[android-developers] Re: DatePicker in a fragment

2011-11-15 Thread kbeal10
The solution I came up with was to subclass DialogFragment, returning a DatePickerDialog in onCreate() @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new DatePickerDialog(sContext, dateSetListener, sDate.get(Calendar.YEAR), sDate.get(Calendar.MONTH),

[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-04-01 Thread kbeal10
Thank you, I will try to implement this when I have time. I now understand where my confusion was stemming from. I was under the impression that each time the CupView Activity was resumed, a new CupView object was created thus creating a new CupThread. However I now see that is not the case, the

[android-developers] Troubles with SurfaceView's surfaceCreated/Destroyed

2009-03-31 Thread kbeal10
I'm writing a game using two different SurfaceView's (RollView and CupView) in two different activities. Both SurfaceView's heavily resemble the LunarLander demo. The RollView SurfaceView is working fine. When leaving the Activity, RollView's surfaceDestroyed() is called, killing the thread. If

[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-03-31 Thread kbeal10
enough code here to really tell what is happening. Also you do know that you can only call Thread.start() once on a particular thread object, right? http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#start() On Tue, Mar 31, 2009 at 6:46 PM, kbeal10 kbea...@gmail.com wrote: I'm

[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-03-31 Thread kbeal10
SensorManagerSimulator.connectSimulator(); // now enable the new sensors mSensorManager.registerListener(mAccellListener, SensorManager.SENSOR_ACCELEROMETER); } } On Mar 31, 10:35 pm, kbeal10 kbea...@gmail.com wrote: This is where the thread variable is declared

[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-03-31 Thread kbeal10
){ } } } } On Mar 31, 10:41 pm, kbeal10 kbea...@gmail.com wrote: This is the main Activity of my app. The one holding a CupView. package my.package; import my.package.CupView.CupThread; import org.openintents.hardware.SensorManagerSimulator; import

[android-developers] Re: Troubles with SurfaceView's surfaceCreated/Destroyed

2009-03-31 Thread kbeal10
will eat a lot of CPU cycles basically doing nothing -- battery drain -- unhappy customers. Pausing and resuming threads should be done using synchronized blocks, wait() statements and notify() statements. On Mar 31, 10:35 pm, kbeal10 kbea...@gmail.com wrote: This is where the thread

[android-developers] Performance of multiple threads.

2009-03-09 Thread kbeal10
I'm currently designing a game that will be displaying several dice. I would like to know the wisest course of action. The dice will extend View (or SurfaceView), so that each will be able to be touched, etc. My question is should I: A.) Spawn one child thread to draw all of the dice (up to 6).

[android-developers] Re: Performance of multiple threads.

2009-03-09 Thread kbeal10
into motions/gestures in 3D space). On Mar 9, 10:51 am, kbeal10 kbea...@gmail.com wrote: I agree, having more than 2 threads seems to break from the traditional paradigm, which is part of the reason it didn't seem like a good answer. Since I wouldn't be able to have a ViewGroup in it's