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.
This commit is contained in:
Terry Wilson 2023-08-24 10:37:53 -07:00 committed by GitHub
parent 3fad52129f
commit 5559d54f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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