Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.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
Android 在编辑文本框中打印字符串_Android_Eclipse_Android Edittext - Fatal编程技术网

Android 在编辑文本框中打印字符串

Android 在编辑文本框中打印字符串,android,eclipse,android-edittext,Android,Eclipse,Android Edittext,我正在写一个简单的程序来计算未知的化学公式PV=nRT。 R是常数8.31 用户可以输入3条数据(从4个可能的编辑文本框中),并从单选按钮中选择要计算的内容。我已经输入了故障保护,所以如果框为空,则使用标准条件。我已经解决了如何计算每个案例的答案,但没有将其显示在适当的文本框中 下面是XML布局 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http:/

我正在写一个简单的程序来计算未知的化学公式PV=nRT。 R是常数8.31

用户可以输入3条数据(从4个可能的编辑文本框中),并从单选按钮中选择要计算的内容。我已经输入了故障保护,所以如果框为空,则使用标准条件。我已经解决了如何计算每个案例的答案,但没有将其显示在适当的文本框中

下面是XML布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <EditText
        android:id="@+id/editText4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/editText3"
        android:layout_below="@+id/editText3"
        android:layout_marginTop="27dp"
        android:ems="10" />
etc x 4


    <RadioGroup
        android:id="@+id/radioGroup1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/button1"
        android:layout_marginRight="33dp" >

        <RadioButton
            android:id="@+id/radio0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:text="@string/pressure" />
etc x 4
    </RadioGroup>

</RelativeLayout>
对不起,所有的代码

我想在editText1框中显示Pressureans等


非常感谢您的帮助。

您想设置文本框的文本吗?使用以下命令:

pressure.setText(yourfloatvalue.toString());

只需使用edittext.settext(值);没问题。接受它作为答案?:)
pressure.setText(yourfloatvalue.toString());