From 5559d54f5d139f4eb7ed36b86951378bea8c138b Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Thu, 24 Aug 2023 10:37:53 -0700 Subject: [PATCH] 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. --- .../java/io/grpc/helloworldexample/HelloworldActivity.java | 7 +++++++ .../app/src/main/res/layout/activity_helloworld.xml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 7588979446..201c385a7a 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 18b05c3bd6..5831f1d1f5 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" />