Mercurial
comparison gara/android/tutorial/src/main/java/com/example/bazel/MainActivity.java @ 46:b9a40c633c93
[Gara] Adding sample android app which will be use C logic for peer to peer connection.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 04 Dec 2025 06:50:40 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 45:ac8626c7859c | 46:b9a40c633c93 |
|---|---|
| 1 package com.example.bazel; | |
| 2 | |
| 3 import android.app.Activity; | |
| 4 import android.os.Bundle; | |
| 5 import android.util.Log; | |
| 6 import android.widget.Button; | |
| 7 import android.widget.TextView; | |
| 8 | |
| 9 /** | |
| 10 * Main class for the Bazel Android "Hello, World" app. | |
| 11 */ | |
| 12 public class MainActivity extends Activity { | |
| 13 @Override | |
| 14 public void onCreate(Bundle savedInstanceState) { | |
| 15 super.onCreate(savedInstanceState); | |
| 16 Log.v("Bazel", "Hello, Android"); | |
| 17 | |
| 18 setContentView(R.layout.activity_main); | |
| 19 | |
| 20 Button clickMeButton = findViewById(R.id.clickMeButton); | |
| 21 TextView helloBazelTextView = findViewById(R.id.helloBazelTextView); | |
| 22 | |
| 23 Greeter greeter = new Greeter(); | |
| 24 | |
| 25 clickMeButton.setOnClickListener(v -> helloBazelTextView.setText(greeter.sayHello())); | |
| 26 } | |
| 27 } |