Created
May 7, 2015 00:04
-
-
Save vexdev/54ef26a8f917e6a6dc94 to your computer and use it in GitHub Desktop.
Really simple activity to be tested with Android Unit Test
This file contains 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
package com.example.android.testingfun; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
/** | |
* Launches NextActivity and passes a payload in the Bundle. | |
*/ | |
public class LaunchActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_launch_next); | |
setupListeners(); | |
} | |
private void setupListeners() { | |
Button launchNextButton = (Button) findViewById(R.id.launch_next_activity_button); | |
launchNextButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(LaunchActivity.this, NextActivity.class); | |
startActivity(intent); | |
finish(); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment