用户输入未显示在logcat android studio中

时间:2020-01-06 19:21:02

标签: java android

oncheck()功能正常,但onlogin()不起作用 toString()也显示红色。

当我输入一些用户名和密码并单击“登录”时,它将显示未知内容,而不是用户名和密码

我认为存在.toString()问题

请告诉我该如何解决

package com.example.loin;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
public void onlogin(View view){

    EditText pas=(EditText)findViewById(R.id.pas);
    EditText txtt=(EditText)findViewById(R.id.txtt);
    Log.i("Username",txtt.getText().toString());
    Log.i("password",pas.getText().toString());
}
public void oncheck(View view){
    Log.i("info","checked!");
}
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

logcat

01-06 21:55:35.060 30039-30039/com.example.loin V/SettingsInterface: invalidate [system]: current 81 != cached 0
01-06 21:55:35.063 30039-30039/com.example.loin D/ActivityThread: holder:android.app.IActivityManager$ContentProviderHolder@5a3b4ae, holder.provider:android.content.ContentProviderProxy@455224f
01-06 21:55:35.323 30039-30078/com.example.loin D/OpenGLRenderer: CacheTexture 4 upload: x, y, width height = 0, 39, 512, 8
01-06 21:55:37.946 30039-30078/com.example.loin D/GraphicBuffer: register, handle(0xb8844e00) (w:480 h:854 s:480 f:0x1 u:0x000f02)
01-06 21:55:37.959 30039-30049/com.example.loin I/System: FinalizerDaemon: finalize objects = 1
01-06 21:55:41.220 30039-30039/com.example.loin I/info: checked!

0 个答案:

没有答案