Created
January 21, 2016 21:21
-
-
Save px-amaac/acd9813d68319c0c8a90 to your computer and use it in GitHub Desktop.
How to test this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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