You are using the AlertDialog inside your main Activity. Basically what is happening is when you use final EditText input = (EditText)findViewById(R.id.etHoras);
Android by default search for the editText in the main Activity where it doesn't exists. So to make android understand that you want the editText from the AlertDialog you have to inflate it's view and then use it to search for the editText.
Since you have already inflated your AlertDialog's view in
LayoutInflater inflater = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout ll= (LinearLayout)inflater.inflate(R.layout.almanaque, null, false);
you will just have to tell android to search for editText present in ll
. This you can use by the following
final EditText input = (EditText)ll.findViewById(R.id.etHoras);