Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Created January 21, 2016 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save px-amaac/acd9813d68319c0c8a90 to your computer and use it in GitHub Desktop.
Save px-amaac/acd9813d68319c0c8a90 to your computer and use it in GitHub Desktop.
How to test this.
public class MyActivity extends AppCompatActivity {
private MyController controller;
private Button continueButton
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
controller = new MyController();
continueButton = (Button) findViewById(R.id.continueButton);
continueButton.setEnabled(true);
controller.initDisplayViews(this, continueButton);
}
}
public class MyController {
private Button continueButton;
public void initDisplayViews(MyActivity activity, Button continueButton) {
this.continueButton = continueButton;
this.continueButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
didEnterInstance();
}
});
}
private void didEnterInstance() {
displayProgressDialog()
makeApiCall(data, new ResponseCallback() {
public void onResponse(Response response) {
startActivity();
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment