コード例 #1
0
  @Override
  public void onStart(Intent intent, int startId) {

    super.onStart(intent, startId);

    try {

      isRunning = true;
      mtTimer1 = new Timer();

      if (share.getFollowSync().equalsIgnoreCase("")) {

      } else {

        String timervalue = share.getFollowSync();
        String result = timervalue.replace(" ", "");
        int timer = Integer.parseInt(result);

        Log.e("timer service", "" + timer);

        int timeinmilli = timer * 60000;
        Log.e("timeinmilli service", "" + timeinmilli);

        mtTimer1.scheduleAtFixedRate(mTasker1, 0, timeinmilli);
      }
    } catch (Exception e) {
      // TODO: handle exception
      CommonFunctionMapid.displayToastshort(
          getApplicationContext(), e.getMessage(), Gravity.CENTER);
    }
  }
コード例 #2
0
  @Override
  public void onCreate() {
    super.onCreate();

    try {

      share = new com.mapid.utils.SharedPrefs(getBaseContext());
      profileid = share.getFollowingProfileid();
      // intent = new Intent(Constants.VIDEOBROADCAST);
      // share = new SharedPrefs(getBaseContext());
    } catch (Exception e) {
      // TODO: handle exception
      CommonFunctionMapid.displayToastshort(
          getApplicationContext(), e.getMessage(), Gravity.CENTER);
    }
  }