btn.setVisibility(View.GONE) or btn.setEnabled(false) You should save your time somewhere, preferences/files/database, and on start of your application, check this value and do as required...
Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Sun, Nov 21, 2010 at 3:11 AM, Garrett <gstein1...@gmail.com> wrote: > Here is the scenario: > > User opens app, they press a button and some activity launches. After > the button is pressed and the activity is executed, I want to disable > the button until the week starts over. Even if they close the app and > come back, it should still be disabled unless it has reset. > > For example, if they press the button on Monday, they should not be > able to do it again until Sunday at 12:00 AM. > > No matter what day they initially press the button, they should not be > able to press again until the week starts over. > > What would be the simplest way to do this in android? Should I have > the program store the date and time they initially press, and then > calculate the time until reset every time they open the app? > > -- > 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<android-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