title: Retrofit 1.9 How to start new Activity from Callback
body: <p>I have simply questions , I think is simply :)
  I can't start new Activity from my CallBack method in Retrofit , I'm getting issue like  </p>
  
  <p><em>" android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?"</em></p>
  
  <pre><code>    sign_in_button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              String userEmail = email.getText().toString();
              String userPassword = password.getText().toString();
  
              final LoginService loginService = RetrofitClient.createService(LoginService.class, userEmail, userPassword);
              loginService.basicLogin(new Callback&lt;User&gt;() {
                  @Override
                  public void success(User user, Response response) {
                      Toast.makeText(getApplicationContext(),"You are Logged", Toast.LENGTH_SHORT).show();
  
                      Intent intent = new Intent(getApplicationContext(), BetweenActivity.class);
                      startActivity(intent);
  
  
  
  
  
                  }
  
                  @Override
                  public void failure(RetrofitError error) {
                      Toast.makeText(getApplicationContext(),"Something went wrong", Toast.LENGTH_SHORT).show();
  
                  }
              });
  </code></pre>
  
  <p>This is my log:</p>
  
  <p>FATAL EXCEPTION: main
                                                                                Process: com.example.bunzlau.retrofit, PID: 18138
                                                                                java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bunzlau.retrofit/com.example.bunzlau.retrofit.BetweenActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.Button.findViewById(int)' on a null object reference
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
                                                                                    at android.app.ActivityThread.access$1100(ActivityThread.java:221)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                    at android.os.Looper.loop(Looper.java:158)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7225)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                                 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.Button.findViewById(int)' on a null object reference
                                                                                    at com.example.bunzlau.retrofit.BetweenActivity.onCreate(BetweenActivity.java:18)
                                                                                    at android.app.Activity.performCreate(Activity.java:6876)
                                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) 
                                                                                    at android.app.ActivityThread.access$1100(ActivityThread.java:221) 
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                    at android.os.Looper.loop(Looper.java:158) 
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:7225) 
                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) </p>