 <p>There is a major flaw in your design. The error is obvious. In this line</p> <pre><code>final helpers helpers = new helpers(); </code></pre> <p>you are trying to create an object of an activity which is a very very bad practice. You cannot simply create an object of an activity like this. All Activities in Android must go through the Activity lifecycle so that they have a valid context attached to them. In this case a valid context is not attached to the helper instance. So as a result the line </p> <pre><code>SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); </code></pre> <p>causes a null pointer as 'this' is null. (Why? Because this refers to the context which has not yet been created as the activity is not started using startActivity(intent))</p> <p><em>Another thing though this is not an error, you must use activity names starting with an upper case letter. It is the convention followed and will make your code more readable. Your code is pretty confusing due to the weird use of upper and lower case names. You declare your class with a lower case letter while at some places the variables are upper case. which causes confusion. The rule is that classes, interfaces, etc should start with upper case letters and variables as lower case.</em></p> <p>So in this case what do you do?</p> <p>You never start your Helper activity and I think you do not need to show it to the user. That is it needs to do some work without user interaction. You should make it a service. And then start it using <code>startService(intent).</code>Or you may also create it as a Java class, depends on your use case. </p> <p>Edit: By the way I answered <a href="http://stackoverflow.com/questions/37092965/android-calling-intentservice-class-from-a-service-class/37096620#37096620">another</a> similar question having the same problem but involving services later today. </p>