I\'m disabling buttons once they are pressed. I want it to activate automatically the next day at 12AM. I really have no idea how to do this. Somehow I tried and written the co
Even though this code is in java, the concept will be the same. Once the alarm goes off, the Broadcastreceiver's onReceive is called, where you can edit the sharedpreference to enable/disable views. If you don't know about sharedpreferences, see these links: How do I use SharedPreferences in Xamarin.Android? , SharedPreferences Example in Xamarin Android
BroadCastReceiver:
public class ReminderActivity extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//Use sharepreference and set the button state disabled or enabled.
SharedPreferences mSharedPreferences = getSharedPreferences("MyPref", 0);
mSharedPreferences..edit().putBoolean("btn_enable", true).commit();
}
}
So once you open the app, check for sharedpreference value and enable or disable the button state accordingly. Hope this helps.