Browse Source

Added AccelerometerActivity

DoNotMerge_Runnable_Test_Branch
Christian Tinz 1 year ago
parent
commit
bd2927ed64

+ 28
- 0
app/src/main/java/com/example/greenwatch/AccelerometerActivity.java View File

package com.example.greenwatch;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class AccelerometerActivity extends AppCompatActivity {

private Button backToMainActivityButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_accelerometer);

backToMainActivityButton = (Button) findViewById(R.id.accelerometerBackToMainActivity);

backToMainActivityButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}

}

+ 25
- 0
app/src/main/res/layout/activity_accelerometer.xml View File

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp"
tools:context=".AccelerometerActivity">

<TextView
android:id="@+id/tvAccelerometerStatusmessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Accelerometer Activity">
</TextView>

<Button
android:id="@+id/accelerometerBackToMainActivity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Back to MainActivity">
</Button>

</LinearLayout>

Loading…
Cancel
Save