Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将TextView设置为分贝强度的字符串-Android Studio_Android_Variables_Textview_Set - Fatal编程技术网

将TextView设置为分贝强度的字符串-Android Studio

将TextView设置为分贝强度的字符串-Android Studio,android,variables,textview,set,Android,Variables,Textview,Set,问题: 将id为“Reading”的textView设置为wifi信号强度测试值 代码: 布局文件: 感谢您提供的任何帮助如果您使用xml属性android:id=“@+id/readOut” 所以整条线都应该是 TextView textView = (TextView) textView.findViewById(R.id.readOut); R代表将生成的类,该类包含应用程序中所需的各种资源 “将id为“readeat”的textView设置为wifi信号强度测试值”-为什么会出

问题:

  • 将id为“Reading”的textView设置为wifi信号强度测试值
代码:

布局文件:



感谢您提供的任何帮助

如果您使用xml属性
android:id=“@+id/readOut”

所以整条线都应该是

TextView textView = (TextView) textView.findViewById(R.id.readOut);

R代表将生成的类,该类包含应用程序中所需的各种资源

“将id为“readeat”的textView设置为wifi信号强度测试值”-为什么会出现问题?你试了什么?我试着在第33行设置文本视图。当我试图使其成为目标读数(即textView的名称)时,它说“无法解析符号”。对不起,但是您发布的代码中没有行号。请共享布局文件。非常抱歉。这是新的。这将是while循环中以“TextView”开头的一行,非常感谢!我试试看。我会投票。。。但我真是个笨蛋,连排名都没有。谢谢你的帮助!因果报应谢谢你哦,如果答案有效,你可以接受(灰色复选标记)。我们都是从noob开始的,所以只要向前看:如果可以的话帮助别人:)只要检查一下就行了!:D非常感谢。我会继续付出,我想我们会把彼此打造成一个社区:)
<?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="com.example.wifilocator.MainActivity">

    <TextView
        android:id="@+id/readOut"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="filler"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>
TextView textView = (TextView) textView.findViewById(R.id.readOut);