but for smaller projects, wouldn't using handlers be a bit of overkill? this is just for waiting for no sensor movement, or restarts basically if there is sensor movement
On Sep 26, 2:26 pm, skink <psk...@gmail.com> wrote: > On Sep 26, 3:21 pm, Kingcrowley <kingcrow...@gmail.com> wrote: > > > > > basically the program, decides whether the phone has moved, if it > > hasn't (time> some set time) then it makes noise and shows a simple > > xml based animation, and the decision part decided which animation/ > > audio to play > > > David > > > On Sep 26, 1:15 pm, skink <psk...@gmail.com> wrote: > > > > On Sep 26, 1:20 pm, Kingcrowley <kingcrow...@gmail.com> wrote: > > > > > So i declare > > > > > ImageView imgView; > > > > ImageView imgView1; > > > > > in onCreate: > > > > > imgView = (ImageView)findViewById(R.id.imageView); > > > > imgView.setBackgroundResource(R.drawable.frame_animation); > > > > > imgView1 = (ImageView)findViewById(R.id.imageView1); > > > > imgView1.setBackgroundResource(R.drawable.frame_animation); > > > > > imgView.setVisibility(View.INVISIBLE); //set imgView invisible > > > > > then later: > > > > > class SoundTimeTask extends TimerTask { > > > > > public void run() { > > > > > switch (warning) { > > > > case 0: > > > > imgView.setVisibility(View.VISIBLE); > > > > frameAnimation = (AnimationDrawable) > > > > imgView.getBackground(); > > > > frameAnimation.start(); > > > > > break; > > > > ............... > > > > > does anyone see anything wrong with that? imgView never appears? > > > > > Thanks, > > > > > David > > > > > On Sep 25, 10:30 pm, Kingcrowley <kingcrow...@gmail.com> wrote: > > > > > > HI, > > > > > > my code seems similar to yours..but doesn't work..could you copy/paste > > > > > in yours if it isn't too long? > > > > > > Thanks a lot > > > > > > David > > > > > > On Sep 25, 9:01 pm, Carmen Delessio <carmendeles...@gmail.com> wrote: > > > > > > > I've got a example with a TextView and EditView where I do this > > > > > > successfully. > > > > > > Seehttp://developer.android.com/reference/android/view/View.html#setVisi... > > > > > > is where View.VISIBLE is defined. > > > > > > Just noticed View.GONE. that could be helpful. > > > > > > > Define TextView and EditText: > > > > > > TextView adminLabel; > > > > > > EditText admin; > > > > > > > Assign from Layout: > > > > > > adminLabel = (TextView)findViewById(R.id.AdminLabel); > > > > > > admin = (EditText)findViewById(R.id.Admin); > > > > > > > Set to invisible: > > > > > > admin.setVisibility(View.INVISIBLE); > > > > > > adminLabel.setVisibility(View.INVISIBLE); > > > > > > > Set to visible: > > > > > > admin.setVisibility(View.VISIBLE); > > > > > > adminLabel.setVisibility(View.VISIBLE); > > > > > > > -- > > > > > > Carmenhttp://www.twitter.com/CarmenDelessiohttp://www.talkingandroid.comhtt... > > > > > > > On Fri, Sep 25, 2009 at 3:49 PM, Kingcrowley > > > > > > <kingcrow...@gmail.com> wrote: > > > > > > > > I was wondering how this works, > > > > > > > > I can set ImageViews VISIBLE or INVISIBLE in OnCreate, but i can't > > > > > > > seem to do it anywhere else properly? > > > > > > > using code like "imgView.setVisibility(ImageView.VISIBLE);" > > > > > > > any pointers/advice? > > > > > > > > Thanks, > > > > > > > > David > > > > why are you using TimerTask? > > > > pskink > > aha, btw android's way is to use Handler & Messages > > pskink --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---