此应用包含一个按钮,单击该按钮应记录“按钮:已单击” 可以,但是我也在logcat中获得了所有这些东西。是什么原因造成的?
鉴于程序多么简单,我不知道应该提供什么其他信息,但是stackoverflow让我在发布此信息之前提供了更多详细信息
package com.test.jacqueline.test;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("Button", "Clicked");
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
tools:context=".MainActivity">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="Button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
2018-10-12 20:35:53.766 11999-11999/com.test.jacqueline.test D/Button: Clicked
2018-10-12 20:35:53.775 1410-1439/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 602158 , only wrote 601920
2018-10-12 20:35:54.451 1410-1440/? W/AudioFlinger: write blocked for 651 msecs, 3 delayed writes, thread 0xabe83040
2018-10-12 20:35:54.451 1410-1439/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 634346 , only wrote 606240
2018-10-12 20:35:54.451 1410-1439/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 606258 , only wrote 606240
2018-10-12 20:35:54.467 1410-1439/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 606987 , only wrote 606960
2018-10-12 20:35:54.494 1410-1440/? D/AudioFlinger: mixer(0xabe83040) throttle end: throttle time(12)
2018-10-12 20:35:56.141 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.JobSchedulerEngine$PhoneskyJobSchedulerJobService.onStartJob(7): onJobSchedulerWakeup with jobId 9000
2018-10-12 20:35:56.144 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ab.a(39): Scheduling fallback in 43199997 (absolute: 51857825)
2018-10-12 20:35:56.149 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ab.a(39): Scheduling fallback in 64799996 (absolute: 73457829)
2018-10-12 20:35:56.158 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.aj.handleMessage(16): DeviceState: DeviceState{currentTime=1539390956154, isCharging=true, isIdle=false, netAny=true, netNotRoaming=true, netUnmetered=true}
2018-10-12 20:35:56.162 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.bm.a(66): Jobs in database: 1-1337 2-48879 12-1
2018-10-12 20:35:56.165 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ae.a(59): Running job: 12-1
2018-10-12 20:35:56.167 10774-10774/? I/Finsky: [1] com.google.android.finsky.contentsync.ContentSyncJob.a(28): ContentSyncJob started
2018-10-12 20:35:56.167 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ae.a(100): RunningQueue size: 1, PendingQueue size: 0
2018-10-12 20:35:56.168 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ae.a(109): Running queue: 12-1
2018-10-12 20:35:56.171 10774-10804/? I/Finsky: [502] com.google.android.finsky.m.c.a(20): Completed 0 account content syncs with 0 successful.
2018-10-12 20:35:56.172 10774-10774/? I/Finsky: [1] com.google.android.finsky.contentsync.ContentSyncJob.a(26): Installation state replication succeeded.
2018-10-12 20:35:56.173 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.bj.b(8): jobFinished: 12-1. TimeElapsed: 8ms
2018-10-12 20:35:56.175 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ae.a(133): Job 12-1 finished
2018-10-12 20:35:56.175 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.ae.a(100): RunningQueue size: 0, PendingQueue size: 0
2018-10-12 20:35:56.176 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.aj.handleMessage(41): Executor finished
2018-10-12 20:35:56.206 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.bm.a(66): Jobs in database: 1-1337 2-48879
2018-10-12 20:35:56.213 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.i.a(68): ConstraintMapping: 1-1337, -> L: 62117847ms, D: 148517847ms, C: false, I: false, N: 1
2018-10-12 20:35:56.220 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.i.a(68): ConstraintMapping: 2-48879, -> L: 0ms, D: 85674014ms, C: true, I: true, N: 2
2018-10-12 20:35:56.221 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(103): Cancelling existing job with id: 9003
2018-10-12 20:35:56.225 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(93): Scheduling job Id: 9001, L: 62117847, D: 148517847, C: false, I: false, N: 1
2018-10-12 20:35:56.227 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(52): Throttling wakeup for job 9002 (expected to run in 0 ms) due to recent wakeup
2018-10-12 20:35:56.227 10774-10774/? I/Finsky: [1] com.google.android.finsky.scheduler.JobSchedulerEngine.a(93): Scheduling job Id: 9002, L: 30000, D: 85674014, C: true, I: true, N: 2
2018-10-12 20:35:57.588 1410-1440/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 905342 , only wrote 756720
2018-10-12 20:36:00.716 10774-10790/? I/Finsky: [489] com.google.android.finsky.bo.ac.run(5): Stats for Executor: BlockingExecutor com.google.android.finsky.bo.ad@b887831[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3]
2018-10-12 20:36:00.717 10774-10790/? I/Finsky: [489] com.google.android.finsky.bo.ac.run(5): Stats for Executor: LightweightExecutor com.google.android.finsky.bo.ad@4a04b16[Running, pool size = 3, active threads = 0, queued tasks = 0, completed tasks = 10]
2018-10-12 20:36:00.717 10774-10790/? I/Finsky: [489] com.google.android.finsky.bo.ac.run(5): Stats for Executor: bgExecutor com.google.android.finsky.bo.ad@824dc97[Running, pool size = 1, active threads = 0, queued tasks = 0, completed tasks = 1]