title: How to check whether user login or not in android?
body: <p>I have an Activity that contains a button. When the user clicks on the button first I have to check whether the user is logged in or not. If the user is not logged in, then first the user has to log in. Then he sees some video. How can I do that?</p>
  
  <p>Code:</p>
  
  <pre><code>findViewById(R.id.btn_dailyReward).setEnabled(true);
  ((Button)findViewById(R.id.btn_dailyReward)).setAlpha(0.5f);
  View.OnClickListener onClickListener = new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          if ((mSupersonicInstance.isRewardedVideoAvailable()))
              mSupersonicInstance.showRewardedVideo();
          else
              Toast.makeText(ControllerActivity.this
                  ,getString(R.string.NO_VIDEO_ADS),Toast.LENGTH_LONG).show();
      }
  };
  findViewById(R.id.btn_dailyReward).setOnClickListener(onClickListener);
  </code></pre>