Skip to content
Snippets Groups Projects
Commit a751456d authored by Andrej Rasevic's avatar Andrej Rasevic
Browse files

Added Lab2_Activity

parent 7c11e68e
No related branches found
No related tags found
No related merge requests found
Showing
with 980 additions and 0 deletions
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.settings
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea
.idea/workspace.xml
.gradle
build/
captures/
# Mac files
.DS_Store
# Windows thumbnail db
Thumbs.db
File added
File added
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "course.labs.activitylab"
minSdkVersion 21
targetSdkVersion 26
testApplicationId "course.labs.activitylab.tests"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.0'
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test1_StartActivityOneTest extends
ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test1_StartActivityOneTest() {
super(ActivityOne.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
// Execution of StartActivityOneTest
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("StartActivityOneTest failed: " + "Section One:"
+ "ActivityOne did not correctly load", solo.waitForActivity(
course.labs.activitylab.ActivityOne.class, timeout));
// ==================== Section Two =====================
// Check for proper counts
assertTrue("StartActivityOneTest failed:" + "Section Two:"
+ "onCreate() count was off for ActivityOne",
solo.waitForText("onCreate\\(\\) calls: 1"));
assertTrue("StartActivityOneTest failed:" + "Section Two:"
+ "onStart() count was off for ActivityOne",
solo.waitForText("onStart\\(\\) calls: 1"));
assertTrue("StartActivityOneTest failed:" + "Section Two:"
+ "onResume() count was off for ActivityOne",
solo.waitForText("onResume\\(\\) calls: 1"));
assertTrue("StartActivityOneTest failed:" + "Section Two:"
+ "onRestart() count was off for ActivityOne",
solo.waitForText("onRestart\\(\\) calls: 0"));
}
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test2_DoubleRotateActivityOneTest extends
ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test2_DoubleRotateActivityOneTest() {
super(ActivityOne.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("DoubleRotateActivityOneTest failed: " +
"Section One:" +
"ActivityOne did not correctly load",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
int sleep = 1000;
solo.sleep(sleep);
// ==================== Section Two =====================
// Rotate the screen
solo.setActivityOrientation(Solo.LANDSCAPE);
// Wait for activity: 'course.labs.activitylab.ActivityOne'
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Two:" +
"ActivityOne did not correctly load after first LANDSCAPE rotation.",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.sleep(sleep);
// ==================== Section Three =====================
// Rotate the screen
solo.setActivityOrientation(Solo.PORTRAIT);
// Wait for activity: 'course.labs.activitylab.ActivityOne'
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Three:" +
"ActivityOne did not correctly load after second PORTRAIT rotation.",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.sleep(sleep);
// Check for proper counts
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Three:" +
"onCreate() count was off for ActivityOne after second PORTRAIT rotation.",
solo.searchText("onCreate\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Three:" +
"onStart() count was off for ActivityOne after second PORTRAIT rotation.",
solo.searchText("onStart\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Three:" +
"onResume() count was off for ActivityOne after second PORTRAIT rotation.",
solo.searchText("onResume\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityOneTest failed:" +
"Section Three:" +
"onRestart() count was off for ActivityOne after second PORTRAIT rotation.",
solo.searchText("onRestart\\(\\) calls: 0"));
}
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test3_StartActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test3_StartActivityTwoTest() {
super(ActivityOne.class);
}
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
// Executes the StartActivityTwoTest
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("StartActivityTwoTest failed:" +
"Section One:" +
"ActivityOne did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
// ==================== Section Two =====================
// Click on Start Activity Two
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
solo.clickOnView(solo
.getView(course.labs.activitylab.R.id.bLaunchActivityTwo));
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("StartActivityTwoTest failed:" +
"Section Two:" +
"ActivityTwo did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
// Check for proper counts after ActivityTwo has been opened
assertTrue("StartActivityTwoTest failed:" +
"Section Two:" +
"onCreate() count was off for ActivityTwo.",
solo.waitForText("onCreate\\(\\) calls: 1"));
assertTrue("StartActivityTwoTest failed:" +
"Section Two:" +
"onStart() count was off for ActivityTwo.",
solo.waitForText("onStart\\(\\) calls: 1"));
assertTrue("StartActivityTwoTest failed:" +
"Section Two:" +
"onResume() count was off for ActivityTwo.",
solo.waitForText("onResume\\(\\) calls: 1"));
assertTrue("StartActivityTwoTest failed:" +
"Section Two:" +
"onRestart() count was off for ActivityTwo.",
solo.waitForText("onRestart\\(\\) calls: 0"));
}
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test4_DoubleRotateActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test4_DoubleRotateActivityTwoTest() {
super(ActivityOne.class);
}
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
// Executes the DoubleRotateActivityTwoTest
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section One:" +
"ActivityOne did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
// ==================== Section Two =====================
// Click on Start Activity Two
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
solo.clickOnView(solo
.getView(course.labs.activitylab.R.id.bLaunchActivityTwo));
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Two:" +
"ActivityTwo did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bClose);
// ==================== Section Three =====================
// Rotate the screen
solo.setActivityOrientation(Solo.LANDSCAPE);
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Three:" +
"ActivityTwo did not correctly load after first LANDSCAPE rotation.",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bClose);
// ==================== Section Four =====================
// Rotate the screen
solo.setActivityOrientation(Solo.PORTRAIT);
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Four:" +
"ActivityTwo did not correctly load after second PORTRAIT rotation.",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bClose);
// Check for proper counts
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Four:" +
"onCreate() count was off for ActivityTwo after second PORTRAIT rotation.",
solo.waitForText("onCreate\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Four:" +
"onStart() count was off for ActivityTwo after second PORTRAIT rotation.",
solo.waitForText("onStart\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Four:" +
"onResume() count was off for ActivityTwo after second PORTRAIT rotation.",
solo.waitForText("onResume\\(\\) calls: 3"));
assertTrue("DoubleRotateActivityTwoTest failed:" +
"Section Four:" +
"onRestart() count was off for ActivityTwo after second PORTRAIT rotation.",
solo.waitForText("onRestart\\(\\) calls: 0"));
}
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test5_CloseActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test5_CloseActivityTwoTest() {
super(ActivityOne.class);
}
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
// Executes the CloseActivityTwoTest
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("CloseActivityTwoTest failed:" +
"Section One:" +
"ActivityOne did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
// ==================== Section Two =====================
// Click on Start Activity Two
solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo));
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("CloseActivityTwoTest failed:" +
"Section Two:" +
"ActivityTwo did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
// ==================== Section Three =====================
// Click on Close Activity
solo.waitForView(course.labs.activitylab.R.id.bClose);
int sleep = 1000;
solo.sleep(sleep);
solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bClose));
// Wait for activity: 'course.labs.activitylab.ActivityOne'
assertTrue("CloseActivityTwoTest failed:" +
"Section Three:" +
"ActivityTwo did not close correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
// Check for proper counts
assertTrue("CloseActivityTwoTest failed:" +
"Section Three:" +
"onCreate() count was off for ActivityOne after ActivityTwo closed.",
solo.waitForText("onCreate\\(\\) calls: 1"));
assertTrue("CloseActivityTwoTest failed:" +
"Section Three:" +
"onStart() count was off for ActivityOne after ActivityTwo closed.",
solo.waitForText("onStart\\(\\) calls: 2"));
assertTrue("CloseActivityTwoTest failed:" +
"Section Three:" +
"onResume() count was off for ActivityOne after ActivityTwo closed.",
solo.waitForText("onResume\\(\\) calls: 2"));
assertTrue("CloseActivityTwoTest failed:" +
"Section Three:" +
"onRestart() count was off for ActivityOne after ActivityTwo closed.",
solo.waitForText("onRestart\\(\\) calls: 1"));
}
}
package course.labs.activitylab.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.robotium.solo.Solo;
import course.labs.activitylab.ActivityOne;
@SuppressWarnings("ALL")
public class Test6_ReopenActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> {
private Solo solo;
public Test6_ReopenActivityTwoTest() {
super(ActivityOne.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
solo.finishOpenedActivities();
}
// Executes the ReopenActivityTwoTest
public void testRun() {
// ==================== Section One =====================
// Wait for activity: 'course.labs.activitylab.ActivityOne'
int timeout = 20000;
assertTrue("ReopenActivityTwoTest failed:" +
"Section One:" +
"ActivityOne did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
// ==================== Section Two =====================
// Click on Start Activity Two
solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo));
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("ReopenActivityTwoTest failed:" +
"Section Two:" +
"ActivityTwo did not load correctly",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bClose);
int sleep = 1000;
solo.sleep(sleep);
// ==================== Section Three =====================
// Click on Close Activity
solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bClose));
// Wait for activity: 'course.labs.activitylab.ActivityOne'
assertTrue("ReopenActivityTwoTest failed:" +
"Section Three:" +
"ActivityTwo did not close correctly",
solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo);
solo.sleep(sleep);
// ==================== Section Four =====================
// Click on Start Activity Two
solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo));
// Wait for activity: 'course.labs.activitylab.ActivityTwo'
assertTrue("ReopenActivityTwoTest failed:" +
"Section Four:" +
"ActivityTwo did not reopen correctly after being closed",
solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout));
solo.waitForView(course.labs.activitylab.R.id.bClose);
// Check for proper counts
assertTrue("ReopenActivityTwoTest failed:" +
"Section Four:" +
"onCreate() count was off for ActivityTwo after being reopened for a second time.",
solo.waitForText("onCreate\\(\\) calls: 1"));
assertTrue("ReopenActivityTwoTest failed:" +
"Section Four:" +
"onStart() count was off for ActivityTwo after being reopened for a second time.",
solo.waitForText("onStart\\(\\) calls: 1"));
assertTrue("ReopenActivityTwoTest failed:" +
"Section Four:" +
"onResume() count was off for ActivityTwo after being reopened for a second time.",
solo.waitForText("onResume\\(\\) calls: 1"));
assertTrue("ReopenActivityTwoTest failed:" +
"Section Four:" +
"onRestart() count was off for ActivityTwo after being reopened for a second time.",
solo.waitForText("onRestart\\(\\) calls: 0"));
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="course.labs.activitylab"
android:versionCode="1"
android:versionName="1.0" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".ActivityOne"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityTwo"
android:label="@string/title_activity_activity_two" >
</activity>
</application>
</manifest>
\ No newline at end of file
package course.labs.activitylab;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class ActivityOne extends Activity {
private static final String RESTART_KEY = "restart";
private static final String RESUME_KEY = "resume";
private static final String START_KEY = "start";
private static final String CREATE_KEY = "create";
// String for LogCat documentation
private final static String TAG = "Lab-ActivityOne";
// Lifecycle counters
// TODO:
// Create counter variables for onCreate(), onRestart(), onStart() and
// onResume()
// TODO: Create variables for each of the TextViews
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_one);
// TODO: Assign the appropriate TextViews to the TextView variables
// Hint: Access the TextView by calling Activity's findViewById()
// textView1 = (TextView) findViewById(R.id.textView1);
Button launchActivityTwoButton = findViewById(R.id.bLaunchActivityTwo);
launchActivityTwoButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO:
// Launch Activity Two
// Hint: use Context's startActivity() method
// Create an intent stating which Activity you would like to start
// Launch the Activity using the intent
}
});
// Has previous state been saved?
if (savedInstanceState != null) {
// TODO:
// Restore value of counters from saved state
}
// Emit LogCat message
Log.i(TAG, "Entered the onCreate() method");
// TODO:
// Update the appropriate count variable
// Update the user interface via the displayCounts() method
}
// Lifecycle callback overrides
@Override
public void onStart() {
super.onStart();
// Emit LogCat message
Log.i(TAG, "Entered the onStart() method");
// TODO:
// Update the appropriate count variable
// Update the user interface
}
@Override
public void onResume() {
super.onResume();
// Emit LogCat message
Log.i(TAG, "Entered the onResume() method");
// TODO:
// Update the appropriate count variable
// Update the user interface
}
@Override
public void onPause() {
super.onPause();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onStop() {
super.onStop();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onRestart() {
super.onRestart();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
// TODO:
// Update the appropriate count variable
// Update the user interface
}
@Override
public void onDestroy() {
super.onDestroy();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
// TODO:
// Save state information with a collection of key-value pairs
}
// Updates the displayed counters
private void displayCounts() {
// TODO:
// Update the user interface via the 4 counter variables
}
}
package course.labs.activitylab;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class ActivityTwo extends Activity {
private static final String RESTART_KEY = "restart";
private static final String RESUME_KEY = "resume";
private static final String START_KEY = "start";
private static final String CREATE_KEY = "create";
// String for LogCat documentation
private final static String TAG = "Lab-ActivityTwo";
// Lifecycle counters
// TODO:
// Create counter variables for onCreate(), onRestart(), onStart() and
// onResume()
// You will need to increment these variables' values when their
// corresponding lifecycle methods get called
// TODO: Create variables for each of the TextViews
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_two);
// TODO: Assign the appropriate TextViews to the TextView variables
// Hint: Access the TextView by calling Activity's findViewById()
// textView1 = (TextView) findViewById(R.id.textView1);
Button closeButton = findViewById(R.id.bClose);
closeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO:
// This function closes Activity Two
}
});
// Has previous state been saved?
if (savedInstanceState != null) {
// TODO:
// Restore value of counters from saved state
}
// Emit LogCat message
Log.i(TAG, "Entered the onCreate() method");
// TODO:
// Update the appropriate count variable
}
// Lifecycle callback methods overrides
@Override
public void onStart() {
super.onStart();
// Emit LogCat message
Log.i(TAG, "Entered the onStart() method");
// TODO:
// Update the appropriate count variable
// Update the user interface
}
@Override
public void onResume() {
super.onResume();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
// TODO:
// Update the appropriate count variable
}
@Override
public void onPause() {
super.onPause();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onStop() {
super.onStop();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onRestart() {
super.onRestart();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
// TODO:
// Update the appropriate count variable
}
@Override
public void onDestroy() {
super.onDestroy();
// TODO:
// Emit LogCat message
// Follow the previous 2 examples provided
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
// TODO:
// Save counter state information with a collection of key-value pairs
// 4 lines of code, one for every count variable
}
// Updates the displayed counters
private void displayCounts() {
// TODO:
// Update the user interface with the 4 counter variables
}
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView android:id="@+id/create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onCreate" />
<TextView android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onStart" />
<TextView android:id="@+id/resume"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onResume" />
<TextView android:id="@+id/restart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onRestart" />
<Button android:id="@+id/bLaunchActivityTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button" />
</LinearLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView android:id="@+id/create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onCreate" />
<TextView android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onStart" />
<TextView android:id="@+id/resume"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onResume" />
<TextView android:id="@+id/restart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onRestart" />
<Button android:id="@+id/bClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/close"
/>
</LinearLayout>
\ No newline at end of file
Lab2_Activity/app/src/main/res/mipmap-hdpi/ic_launcher.png

8.02 KiB

Lab2_Activity/app/src/main/res/mipmap-ldpi/ic_launcher.png

2.5 KiB

Lab2_Activity/app/src/main/res/mipmap-mdpi/ic_launcher.png

3.97 KiB

Lab2_Activity/app/src/main/res/mipmap-xhdpi/ic_launcher.png

13.2 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment