When I run this code on Android Studio and select the login button, I encounter the following error:  Process: com.example.barbershop, PID: 26295 java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.barbershop.models.LoginResponse.getError()' on a null object reference     at com.example.barbershop.activities.LoginActivity$1$1.onResponse(LoginActivity.java:53)     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)   and this is my code   @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_login);      final EditText emailEditText = findViewById(R.id.input_email);     final EditText passwordEditText = findViewById(R.id.input_password);     Button signInButton = findViewById(R.id.btn_signin);     final SharedPreferences sharedPreferences = getSharedPreferences(MainActivity.LOGIN_SHARED_PREF,MODE_PRIVATE);       signInButton.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             final ProgressDialog progressDialog = new ProgressDialog(LoginActivity.this);             progressDialog.setMessage("Authenticating...");             progressDialog.show();             String email = emailEditText.getText().toString();             String password = passwordEditText.getText().toString();             // Login             ApiInterface apiInterface = ApiClient.getClient().create(ApiInterface.class);             Call&lt;LoginResponse&gt; loginCall = apiInterface.login(email,password);             loginCall.enqueue(new Callback&lt;LoginResponse&gt;() {                 @Override                 public void onResponse(Call&lt;LoginResponse&gt; call, Response&lt;LoginResponse&gt; response) {                     progressDialog.hide();                     if (response.body().getError() == 0){                         Intent intent = new Intent(LoginActivity.this, MainActivity.class);                         intent.putExtra(MainActivity.SPOT_ID_KEY, response.body().getId());                         sharedPreferences.edit().putInt(MainActivity.SPOT_ID_KEY, response.body().getId()).apply();                         startActivity(intent);                     }                       else {                         Toast.makeText(LoginActivity.this, response.body().getMessage(), Toast.LENGTH_LONG).show();                     }                 }   I want to connect to the server and log in, but I am currently encountering this error.  this is a LoginResponse class code  @SerializedName("error") public int error; @SerializedName("message") private String message; @SerializedName("id") private int id;  public int getError() {     return error; }  public int getId() {     return id; }  public String getMessage() {     return message; }  public void setError(int error) {     this.error = error; }  public void setId(int id) {     this.id = id; }  public void setMessage(String message) {     this.message = message; }   and this is a link for response class code     Any help would be appreciated, Thanks
129
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
46438
when i select the records in vf page ,after click on the VF Button the conga should be call along with id for generating the PDF but on button click the window is opening but showing error that "ID Parameter is missing" ? how to over come the issue? your reply will be appricated ,please reply asap.  vfpage:  &lt;apex:commandButton value="Generate Invoice" action="{!GenerateInvoice}"  onclick="openConga(setOfIds)" reRender="table1"/&gt;  &lt;script&gt; function openConga(setOfIds){   if(setOfIds !=Null){   var Formastring=setOfIds.splits(',');   var joinIds=Formastring.join("'|'");   var removeSpace=joinIds.replace(" ","");   var removeLeft=removeSpace.replace("[","");   var removeRight=removeLeft.replace("]","");   var finalSetIds=removeRight;    var CongaUrl ="/apex/APXTConga4__Conga_Composer?sessionId={!$API.Session_ID}" +"&amp;serverUrl={!$API.Partner_Server_URL_290}&amp;Id={!Payment_Id}" +"&amp;QVar1Id=[sql1221]a186C0000007yB3?pv1=" + finalSetIds +"&amp;TemplateId={QVar1}";  window.open(CongaUrl, "Conga","menubar=no,height=600,width=800");    } } &lt;/script&gt;   controller:  [‎28-‎01-‎2019 12:13]  Sakhare, Ankita:   public PageReference GenerateInvoice() {     selectedEsr = new List &lt; Payment__c &gt; ();     for (wrappayment wp: paymentList) {         if (wp.selected == true) {             Payment_Id = wp.pay.id;          }     }      return null; }
95979
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was:      Apex trigger updatequotestatus caused an unexpected exception, contact your administrator: updatequotestatus: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.updatequotestatus line 5, column 1.   Error Occured at Line:     if((t.what.getsobjecttype() == quote__c.sobjecttype) &amp;&amp; (t.subject.substring(0,5) == 'Email')  trigger updatequotestatus on task (after insert, after update){     Set&lt;Id&gt; quoteIds = new Set&lt;Id&gt;();     List&lt;quote__c&gt; quotes = new List&lt;quote__c&gt;();      for(task t:trigger.new){         if(t.whatId!=null){             if((t.what.getsobjecttype() == quote__c.sobjecttype) &amp;&amp; (t.subject.substring(0,5) == 'Email')){                 quoteIds.add(t.whatId);             }         }     }      for(quote__c q:[select StageName__c from quote__c where Id IN : quoteIds]){         quote__c qt = new quote__c();         qt.Id = q.Id;         qt.StageName__c = 'Proposal Sent';         quotes.add(qt);     }      if(quotes.size()&gt;0){         update quotes;     } }
16225
Why does it (apparently) make a difference whether I pass null as an argument directly, or pass an Object that I assigned the value null?  Object testVal = null; test.foo(testVal);    // dispatched to foo(Object) // test.foo(null);    // compilation problem -&gt; "The method foo(String) is ambiguous"     public void foo(String arg) { // More-specific     System.out.println("foo(String)"); }  public void foo(Object arg) { // Generic     System.out.println("foo(Object)"); }   In other words, why is the (commented-out) second call to foo(...) not dispatched to foo(Object)?  Update: I use Java 1.6. I could compile Hemal's code without problems, but mine still doesn't compile. The only difference I see is that Hemal's methods are static while mine are not. But I really don't see why this should make a difference...?  Update 2: Solved. I had another method foo(Runnable) in my class, so the dispatcher couldn't unambiguously select the single most specific method. (See my comment in Hemal's second answer.) Thanks everyone for your help.
20599
I am receiving apex errors with the following code:   public with sharing class AddExistingSpecsExt {      public Specifications__c loadedSpec { get; private set; }  public AddExistingSpecsExt() {     String specId = ApexPages.currentPage().getParameters().get('id');     if (String.isBlank(specId)) return;      List&lt;Specifications__c&gt; candidates = [         SELECT Id, Name, Product__c FROM Specifications__c WHERE Id = :specId LIMIT 1     ];     if (!candidates.isEmpty()) loadedSpec = candidates[0]; }     public PageReference associate () {          Specifications__c candidates = new Specifications__c ( Id = Specifications__c.Product__c, Name = Specifications__c.Id);          try {             Database.update(candidates);         } catch (Exception error) {             ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Error while associating.' + error.getMessage()));         }          PageReference page = new PageReference('/' + candidates);          return page.setRedirect(true);     }      public PageReference cancel () {         PageReference page = new PageReference('/' + Null);         return page.setRedirect(true);             }  }   Attempting to add records to a related list through a custom button and small vf page.   The Error is Line 16      Invalid initial expression type for field Specifications__c.Id, expecting: Id   Any help?
59367
I got a situation where i need to invoke future method from batch class. And i know that it is not possible to do. But there might be some workarounds to achieve it, right? And i dont want to invoke future method using shedule apex as my requirement will hit governor limits of "Total number of schedule jobs exceed". So i tried in below ways, but still fighting with same issue.  My design is  Scenario 1 :   Schedule Apex ===> 2. BatchClass (Runs every hour) (Generates a map with "N" records for every batch context, and passes it to Future method in an apex class)  ===> 3. Future method ( then it will login to a salesforce account and generates an attachment and sends an email to a corresponding email address) .   Scenario 2 :  Since, It is not possible to invoke future method from batch, i tried implementing an apex class with a normal static method  invoking future method and in a batch class, for every context i.e., execute() method, it will invoke a normal method which in turn invokes future method, but still got the same error      FATAL ERROR: Future method cant be called from future or Batch   ie.,   global class BatchClass implements Database.batachable&lt;Sobject&gt; {    global Iterable&lt;ScheduledReport__c&gt; start(Database.BatchableContext BC)  {         query=[];        return query;  }  global void execute(Database.BatchableContext BC, List&lt;ScheduledReport__c&gt; scope) {      FutureClass.normalMethod(mapRecords);   }    global void finish(Database.BatchableContext BC){   }  }   Future Class:   global class FutureClass {  global static void normalMethod(Map&lt;&gt; mapR) {      futureMethod(mapR);  }  @future(callout=true)  global static void futureMethod(Map&lt;&gt; m) {      //some code;   }  }   Scenario 3 :  Instead of invoking future class method from batch i tried updating list of records and done checkbox value to true and i've implemented after update event trigger to get the all the records in which checkbox values are true and from trigger i tried invoking future method , still didnt work , i got an error      FATAL ERROR: Future method cant be called from future or Batch   Please help me out.   Thanks !
11494
App version 1.0.27  If you the notification pane and click on the loading icon while it's spinning, the app will cause the app to crash.  03-26 22:51:08.331 E/AndroidRuntime(5927): FATAL EXCEPTION: main 03-26 22:51:08.331 E/AndroidRuntime(5927): java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.util.ArrayList.get(ArrayList.java:310) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.stackexchange.marvin.ui.BaseActivity$3.onItemClick(BaseActivity.java:266) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AdapterView.performItemClick(AdapterView.java:298) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView.performItemClick(AbsListView.java:1100) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2788) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.widget.AbsListView$1.run(AbsListView.java:3463) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Handler.handleCallback(Handler.java:730) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Handler.dispatchMessage(Handler.java:92) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.os.Looper.loop(Looper.java:137) 03-26 22:51:08.331 E/AndroidRuntime(5927): at android.app.ActivityThread.main(ActivityThread.java:5103) 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.lang.reflect.Method.invokeNative(Native Method) 03-26 22:51:08.331 E/AndroidRuntime(5927): at java.lang.reflect.Method.invoke(Method.java:525) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 03-26 22:51:08.331 E/AndroidRuntime(5927): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 03-26 22:51:08.331 E/AndroidRuntime(5927): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126) 03-26 22:51:08.331 E/AndroidRuntime(5927): at dalvik.system.NativeStart.main(Native Method)   (Think I should calm down on finding bugs for a little while? :P)
24554
I have a lookup relationship.  If I just do the following query it works fine:  Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId]; system.debug('c:' + c);   However with the following I get an error:  Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId]; String c2 = (String) r.getSobject('field__r').get('fieldchild__c');   Error message:     FATAL_ERROR System.NullPointerException: Attempt to de-reference a   null object
80203
This error should be a simple one but I cant seem to make it work. The problem lies in the fact that this very same code works earlier in the program. I don's see any reason for it to be sending an error on this instance and not the four previous ones. Reference the code below, and feel free to provide any criticism you may have as it should make me better. If it matters, I am using Sharp Develop 2.2.  Here is an example of the code that works:  void calc2Click(object sender, EventArgs e) {     if (!String.IsNullOrEmpty(tb2_fla.Text) &amp; String.IsNullOrEmpty(tb2_e.Text) | String.IsNullOrEmpty(tb2_fla.Text) &amp; String.IsNullOrEmpty(tb2_e.Text) | String.IsNullOrEmpty(tb2_e.Text))     {         MessageBox.Show("Enter either kVA and Voltage or FLA and Voltage", "Invalid Data Entry", MessageBoxButtons.OK);     }                 if (!String.IsNullOrEmpty(tb2_kva.Text) &amp; !String.IsNullOrEmpty(tb2_e.Text))     {              decimal x, y, z;             x = decimal.Parse(tb2_kva.Text);                   y = decimal.Parse(tb2_e.Text);             z = (x * 1000) / (1.732050808m * y); //the m at the end of the decimal allows for the multiplication of decimals                 tb2_fla.Text = z.ToString();             tb2_fla.Text = Math.Round(z,2).ToString();     }         else     {         if (!String.IsNullOrEmpty(tb2_fla.Text) &amp; !String.IsNullOrEmpty(tb2_e.Text))     {              decimal x, y, z;             x = decimal.Parse(tb2_fla.Text);                   y = decimal.Parse(tb2_e.Text);             z = (x * y * 1.732050808m) / 1000; //the m at the end of the decimal allows for the multiplication of decimals               tb2_kva.Text = Math.Round(z,2).ToString();      }   Here is the example of the code that sends the error in the subject line of this post:  void Calc4Click(object sender, EventArgs e) {         if (!String.IsNullOrEmpty(tb4_fla.Text) &amp;&amp; String.IsNullOrEmpty(tb4_e.Text) || String.IsNullOrEmpty(tb4_kw.Text) &amp; String.IsNullOrEmpty(tb4_e.Text) || String.IsNullOrEmpty(tb4_e.Text))         {   //If values are entered improperly, the following message box will appear         MessageBox.Show("Enter either FLA and Voltage or kW and Voltage", "Invalid Data Entry", MessageBoxButtons.OK);         }              if (!String.IsNullOrEmpty(tb4_fla.Text)&amp;&amp; !String.IsNullOrEmpty(tb4_e.Text)&amp;&amp; String.IsNullOrEmpty(tb4_kw.Text))         {//If the user eneters FLA and Voltage calculate for kW              decimal x, y, z;             x = decimal.Parse(tb4_fla.Text);             y = decimal.Parse(tb4_e.Text);             z = (x*y)*(.8 * 1.732050808m);             tb4_kw.Text = Math.Round(z,0).ToString();          }                         if (!String.IsNullOrEmpty(tb4_kw.Text) &amp;&amp; !String.IsNullOrEmpty(tb4_e.Text) &amp;&amp; String.IsNullOrEmpty(tb4_fla.Text))         {;//If the user enters kW and Voltage calculate for FLA             decimal x, y, z;             x = decimal.Parse(tb4_kw.Text);             y = decimal.Parse(tb4_e.Text);             z = (1000 * x)/(y * 1.732050808m)* .8;             tb4_fla.Text = Math.Round(z,0).ToString();         }      }   I appreciate any help that I can get.  Thank you.
120685
It seems to me that a lot of my debugging time is spent chasing down null-reference exceptions in complex statements. For instance:  For Each game As IHomeGame in _GamesToOpen.GetIterator()   Why, when I get a NullReferenceException, can I get the line number in the stack trace, but not the name of the object that equals null. In other words, why:  Object reference not set to an instance of an object.   instead of  _GamesToOpen is not set to an instance of an object.   or  Anonymous object returned by _GamesToOpen.GetIterator() is null.   or  game was set to null.   Is this strictly a design choice, meant to protect the anonymity of the code or is there a compelling reason in compiler design not to include this information in the debug-time exception?
65261
What are some real world places that call for delegates?  I'm curious what situations or patterns are present where this method is the best solution.  No code required.
105996
When I'm debugging, I often have to deal with methods that does not use an intermediate variable to store the return value :     private int myMethod_1()    {       return 12;    }     private int myMethod_2()    {       return someCall( someValue );    }   Well, in order to recreate a bug, I often have to change values on the fly. Here, I could want to see what happens when myMethode_1 return zero. Same thing for myMethod_2.  Is there a way to do that without modifying the code ? What I would like to do, it's to place a breakpoint on the return line (or on the closing bracket) and type-in a new return value.  Note : I'm using Visual Studio 2005 and Visual Studio 2008.  Thank !
96652
I am facing Mixed DML error in the following case:  static testmethod void method1() {     User u1 = DataFactory.createUser('testUser','test@user.com','permissionSetAPIname');        Obj1 rec1 = DataFactory.createrec1('Record1');     insert rec1;      Obj2 rec2 = DataFactory.createrec2('Rec2',rec1,system.today()-10, system.today()+10 );     insert rec2;       Obj3 rec3 = DataFactory.createrec3(rec2,'Tester',u1,'US');     insert Role;      test.starttest();         //testing code      test.stoptest();  }   However the following is working fine  static testmethod void method1() {      User u1 = new User(Alias = 'testRole',                   Email             = 'role@test.com',                   EmailEncodingKey  = 'UTF-8',                   LastName          = 'user',                   FirstName         = 'test',                   LanguageLocaleKey = 'en_US',                   LocaleSidKey      = 'en_US',                   ProfileId         = [select Id from Profile where Name = 'Basic User' limit 1].Id,                   TimeZoneSidKey    = 'America/Chicago',                   Username          = 'stakeholder@test' + Math.round(Math.random() * 10000) + '.com',                   UserRoleId        = null,                   Country           = 'Great Britain');     insert u1;         Obj1 rec1 = DataFactory.createrec1('Record1');     insert rec1;      Obj2 rec2 = DataFactory.createrec2('Rec2',rec1,system.today()-10, system.today()+10 );     insert rec2;       Obj3 rec3 = DataFactory.createrec3(rec2,'Tester',u1,'US');     insert Role;      test.starttest();         //testing code      test.stoptest();  }   Please explain the difference. As my understanding is that transaction remains the same in both the cases.
123913
App version: 1.0.52  When you edit a question and rotate the screen while the "Getting preview" or "Posting edit" dialog is showing the app will crash.  12-25 21:38:07.033 E/AndroidRuntime(4768): FATAL EXCEPTION: main 12-25 21:38:07.033 E/AndroidRuntime(4768): Process: com.stackexchange.marvin, PID: 4768 12-25 21:38:07.033 E/AndroidRuntime(4768): java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{42440ba0 V.E..... R......D 0,0-684,192} not attached to window manager 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:370) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:299) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.app.Dialog.dismissDialog(Dialog.java:329) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.app.Dialog.dismiss(Dialog.java:312) 12-25 21:38:07.033 E/AndroidRuntime(4768): at com.stackexchange.marvin.core.OperationThatCanFail$1.onPostExecute(OperationThatCanFail.java:81) 12-25 21:38:07.033 E/AndroidRuntime(4768): at com.stackexchange.marvin.core.OperationThatCanFail$1.onPostExecute(OperationThatCanFail.java:67) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.os.AsyncTask.finish(AsyncTask.java:632) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.os.AsyncTask.access$600(AsyncTask.java:177) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.os.Handler.dispatchMessage(Handler.java:102) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.os.Looper.loop(Looper.java:136) 12-25 21:38:07.033 E/AndroidRuntime(4768): at android.app.ActivityThread.main(ActivityThread.java:5097) 12-25 21:38:07.033 E/AndroidRuntime(4768): at java.lang.reflect.Method.invokeNative(Native Method) 12-25 21:38:07.033 E/AndroidRuntime(4768): at java.lang.reflect.Method.invoke(Method.java:515) 12-25 21:38:07.033 E/AndroidRuntime(4768): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 12-25 21:38:07.033 E/AndroidRuntime(4768): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 12-25 21:38:07.033 E/AndroidRuntime(4768): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) 12-25 21:38:07.033 E/AndroidRuntime(4768): at dalvik.system.NativeStart.main(Native Method) 12-25 21:38:07.035 W/ActivityManager(27384):   Force finishing activity com.stackexchange.marvin/.ui.AskOrEditQuestionActivity
109534
I am trying to write a test class.  My Apex class has the following constructor:  public NController(ApexPages.StandardController controller) {      cas =  (Case) controller.getRecord();     csId = cas.Id;     owner = cas.OwnerId;      N_SSettings__c nhdsms = N_SSettings__c.getValues('Int');     rate=nhdsms.Rate_Code__c;     accId=nhdsms.Acc_Id__c;  }   Here N_SSettings__c is a custom settings which has two fields Rate_Code__c and Acc_Id__c. It has a record called 'Int' with both Rate_Code__c and Acc_Id__c field values populated.  I am using the following test class method:  @isTest public class NHSsendSMSController_Test {     public static testMethod void NHSsendSMSControllerTest()     {         Case caseObj = new Case();         insert caseObj;         ApexPages.StandardController sc = new ApexPages.standardController(caseObj);         NController nControllerObj = new NController(sc);         nControllerObj.methodName();     } }   When I run the test method, it is throwing a null pointer exception on the line :  rate = nhdsms.Rate_Code__c;   The custom setting is definitely present with the required values of both the fields of Int.
93419
I am using Structure map like the MVC storefront by Rob Conery does and I have an AdminController and so to get to it I just type:  website/Admin/action   however if I miss spell the controller name I get the error below:  Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key  There error occurs on this line:  Controller controller = ObjectFactory.GetInstance(controllerType) as Controller;   Does anyone have any ideas on how I can handle this error or not allow it to happen at all and maybe just goto a 404 page??  Cheers in advance
28359
I'm trying to build an Android test application integrated to the SalesForce platform. I have downloaded the SDK from , and imported it to my workspace. Everything works fine except my test app, even the  they have provided along with the SDK work without problem. As a first step, what I tried was to clone the basic features (just login as of now) from the RestExplorer app. The following are my important files.  public class Home extends Activity {  private PasscodeManager passcodeManager; private RestClient client; private TokenRevocationReceiver tokenRevocationReceiver;  RestClient getClient() {     return client; }  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);      passcodeManager = SalesforceSDKManager.getInstance().getPasscodeManager();     tokenRevocationReceiver = new TokenRevocationReceiver(this);     setContentView(R.layout.activity_home);  }  @Override  public void onResume() {     super.onResume();     registerReceiver(tokenRevocationReceiver, new IntentFilter(ClientManager.ACCESS_TOKEN_REVOKE_INTENT));           if (passcodeManager.onResume(this)) {   // Bring up passcode screen if needed         String accountType = SalesforceSDKManager.getInstance().getAccountType();   // Login options         new ClientManager(this, accountType, SalesforceSDKManager.getInstance().getLoginOptions(), SalesforceSDKManager.getInstance().shouldLogoutWhenTokenRevoked()).getRestClient(this, new RestClientCallback() {    // Get a rest client             @Override             public void authenticatedRestClient(RestClient client) {                 if (client == null) {                     SalesforceSDKManager.getInstance().logout(Home.this);                     return;                 }                 Home.this.client = client;                           }         });     } }  @Override protected void onPause() {     passcodeManager.onPause(this);     unregisterReceiver(tokenRevocationReceiver);     super.onPause(); } }   I have added the permissions as required  &lt;permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE"     android:protectionLevel="signature" /&gt;  &lt;uses-permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.GET_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.ACCOUNT_MANAGER"/&gt;   And extended the application object to give a call to init();  public class MyApp extends Application { @Override public void onCreate() {     super.onCreate();     SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), Home.class); } }   Now, I'm getting the error in my Android debug log. The log as I see is attached below. It keep the activity restarting till I forcefully kill the application.  11-08 15:56:23.883: I/ClientManager:getRestClient(9334): No account of type com.salesforce.androisdk found 11-08 15:56:23.898: W/AccMgrCallback:run(9334): android.accounts.AuthenticatorException: bind failure 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1726) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.access$400(AccountManager.java:144) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:1572) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.os.Binder.execTransact(Binder.java:388) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at dalvik.system.NativeStart.run(Native Method)   Do anyone have any idea about this isse? It is such a basic app, I was not expecting anything unusual. Did I do anything wrong in my app?