@@ -35,7 +35,7 @@ public class wuastaFragment extends Fragment implements View.OnClickListener {
3535 Toast toast ;
3636 int dayfactor ;
3737 long departureepoch ;
38- Integer tempfd ;
38+ Integer tempfd = null ;
3939
4040 @ Nullable
4141 @ Override
@@ -280,18 +280,11 @@ public void onClick(View view) {
280280
281281 case R .id .setalarmbutton :
282282
283- int df = sp .getInt ("dayfactor" ,1 );
283+ int df = sp .getInt ("dayfactor" ,0 );
284284 int hur = sp .getInt ("phour" ,0 );
285285 int mun = sp .getInt ("pminute" ,0 );
286286
287- long currentepoch = System .currentTimeMillis ();
288- long currentepochdate = (currentepoch +5 *60 *60 *1000 +30 *60 *1000 ) - (currentepoch +5 *60 *60 *1000 +30 *60 *1000 )%86400000 ;
289- long timeofalarm = currentepochdate + (sp .getInt ("phour" ,0 ))*60 *60 *1000
290- + (sp .getInt ("pminute" ,0 ))*60 *1000 + df *86400000 ;
291-
292- if (df ==0 ) {
293- ((MainActivity ) getActivity ()).createAlarm (df , hur , mun );
294- }
287+ ((MainActivity ) getActivity ()).createAlarm (df , hur , mun );
295288
296289 if (toast != null ) toast .cancel ();
297290 toast = Toast .makeText (getActivity (), "Alarm Set" , Toast .LENGTH_LONG );
@@ -371,6 +364,8 @@ protected Integer doInBackground(URL... params) {
371364
372365 }
373366
367+ if (getTempfd () != null ) sd = getTempfd ();
368+
374369 int settimeepoch = hr *60 + mn - fd - sharedPref1 .getInt ("delay" ,0 );
375370
376371 hr = settimeepoch >= 60 ? settimeepoch /60 : 0 ;
0 commit comments