title: Android Get Context in a function
body: <p>I am a novice, just making my first app, so please excuse my poor phrasing and understanding.  </p>
  
  <p>I have made a Class MyAlarms() to help manage my alarm and notification code.  I require context for a few functions, namely Toast, SharedPreferences, and PendingIntent.  GetContext() does not work, nor does getApplicationContext(), so I decided to go with passing the context to MyAlarms(Context context) from the code using it.  This works just fine.</p>
  
  <p>But I have now read that I should not be doing this, as to may lead to memory leak issues.   Is there another way to get context in a class?</p>
  
  <p>Thanks in advance!</p>