aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Wilson <tmwilson@google.com>2023-08-24 10:37:53 -0700
committerGitHub <noreply@github.com>2023-08-24 10:37:53 -0700
commit5559d54f5d139f4eb7ed36b86951378bea8c138b (patch)
treeb56b5b32c7d2ac585fb4510fd635c52d4b6c45bb
parent3fad52129f9a96bed16d0eac34871501850ee9dc (diff)
downloadgrpc-grpc-java-5559d54f5d139f4eb7ed36b86951378bea8c138b.tar.gz
examples: Android helloworld to pass Google lint (#10518)
These changes allow the Android helloworld example to pass the lint checks of the Google internal build system.
-rw-r--r--examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java7
-rw-r--r--examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml3
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java b/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java
index 758897944..201c385a7 100644
--- a/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java
+++ b/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java
@@ -50,6 +50,13 @@ public class HelloworldActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_helloworld);
sendButton = (Button) findViewById(R.id.send_button);
+ sendButton.setOnClickListener(
+ new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ sendMessage(v);
+ }
+ });
hostEdit = (EditText) findViewById(R.id.host_edit_text);
portEdit = (EditText) findViewById(R.id.port_edit_text);
messageEdit = (EditText) findViewById(R.id.message_edit_text);
diff --git a/examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml b/examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml
index 18b05c3bd..5831f1d1f 100644
--- a/examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml
+++ b/examples/android/helloworld/app/src/main/res/layout/activity_helloworld.xml
@@ -13,6 +13,7 @@
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="wrap_content"
+ android:inputType="text"
android:hint="Enter Host" />
<EditText
android:id="@+id/port_edit_text"
@@ -28,13 +29,13 @@
android:id="@+id/message_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:inputType="text"
android:hint="Enter message to send" />
<Button
android:id="@+id/send_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:onClick="sendMessage"
android:text="Send Grpc Request" />
<TextView