Buggy code:
public class SelectDialogue extends DialogFragment { private Context con ; private String id_Dieta ; private boolean accept ; private SelectDialogue . broadcastReceiver messageReceiver = new SelectDialogue . broadcastReceiver ( ) ; private AlarmManager alarm ; private Intent intent ; private PendingIntent pintent ; public SelectDialogue ( Context con , String id_Dieta , boolean acc ) { } @ Override public Dialog onCreateDialog ( Bundle savedInstanceState ) { con . registerReceiver ( messageReceiver , new IntentFilter ( "com.example.miyoideal.extra" ) ) ; AlertDialog . Builder builder = new AlertDialog . Builder ( getActivity ( ) ) ; if ( accept ) { builder . setMessage ( "¿Deseas<seq2seq4repair_space>tomar<seq2seq4repair_space>esta<seq2seq4repair_space>dieta?" ) . setPositiveButton ( "Si" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { Calendar c = Calendar . getInstance ( ) ; SimpleDateFormat df = new SimpleDateFormat ( "dd-MMM-yy" ) ; String todayDate = df . format ( c . getTime ( ) ) ; ContentValues cv = new ContentValues ( ) ; cv . put ( "id_dieta" , id_Dieta ) ; cv . put ( "dia" , todayDate ) ; SQLiteControl db = new SQLiteControl ( con ) ; db . getWritableDatabase ( ) . update ( "control" , cv , ( ( "id_control<seq2seq4repair_space>" + "=" ) + 1 ) , null ) ; Calendar cal = Calendar . getInstance ( ) ; String tex = new API ( con ) . getDia ( ) ; intent = new Intent ( con , MyService . class ) ; intent . putExtra ( "dia_inicial" , tex ) ; DTO_Dieta dieta = new com . example . DAO . DAO_Dieta ( con ) . getDieta ( new API ( con ) . getID_Dieta ( ) ) ; intent . putExtra ( "duracion" , dieta . getDuracion ( ) ) ; pintent = PendingIntent . getService ( con , 1234 , intent , 0 ) ; alarm = ( ( AlarmManager ) ( con . getSystemService ( ALARM_SERVICE ) ) ) ; <START_BUG> alarm . setRepeating ( RTC_WAKEUP , cal . getTimeInMillis ( ) , ( 5 * 1000 ) , pintent ) ; <END_BUG> } } ) . setNegativeButton ( "No" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { } } ) ; } else { builder . setMessage ( "Ya<seq2seq4repair_space>tienes<seq2seq4repair_space>un<seq2seq4repair_space>programa<seq2seq4repair_space>de<seq2seq4repair_space>dieta<seq2seq4repair_space>¿Deseas<seq2seq4repair_space>cambiar?" ) . setPositiveButton ( "Si" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { Calendar c = Calendar . getInstance ( ) ; SimpleDateFormat df = new SimpleDateFormat ( "dd-MMM-yy" ) ; String todayDate = df . format ( c . getTime ( ) ) ; ContentValues cv = new ContentValues ( ) ; cv . put ( "id_dieta" , id_Dieta ) ; cv . put ( "dia" , todayDate ) ; SQLiteControl db = new SQLiteControl ( con ) ; db . getWritableDatabase ( ) . update ( "control" , cv , ( ( "id_control<seq2seq4repair_space>" + "=" ) + 1 ) , null ) ; Calendar cal = Calendar . getInstance ( ) ; Intent intent = new Intent ( con , MyService . class ) ; String dia = new API ( con ) . getDia ( ) ; intent . putExtra ( "dia_inicial" , new API ( con ) . getDia ( ) ) ; DTO_Dieta dieta = new com . example . DAO . DAO_Dieta ( con ) . getDieta ( new API ( con ) . getID_Dieta ( ) ) ; intent . putExtra ( "duracion" , dieta . getDuracion ( ) ) ; pintent = PendingIntent . getService ( con , 1234 , intent , 0 ) ; alarm = ( ( AlarmManager ) ( con . getSystemService ( ALARM_SERVICE ) ) ) ; alarm . setRepeating ( RTC_WAKEUP , cal . getTimeInMillis ( ) , ( 18000 * 1000 ) , pintent ) ; } } ) . setNegativeButton ( "No" , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int id ) { } } ) ; } return builder . create ( ) ; } private class broadcastReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context context , Intent inten ) { } } }

Fix:
alarm . setRepeating ( RTC_WAKEUP , cal . getTimeInMillis ( ) , ( 18000 * 1000 ) , pintent ) ;