我正在开发一个应用程序,其中有三个单选按钮的活动。 这是我的.xml代码...在android中选择Radiobutton
<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"
tools:context=".MainActivity" >
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:hint="@string/hint"
android:ems="10" />
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:layout_marginLeft="30dp"
android:gravity="center" >
<RadioButton
android:id="@+id/rad1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="@string/rad1" />
<RadioButton
android:id="@+id/rad2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="@string/rad2" />
<RadioButton
android:id="@+id/rad3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rad3"
android:layout_marginLeft="8dp" />
</RadioGroup>
</RelativeLayout>
我要转换的EditText的输入文本,十六进制,十进制格式。 默认情况下,它是文本值。 当用户选择十六进制单选按钮时,文本应该被转换为十六进制。 之后,当用户选择十进制,然后十六进制应转换为十进制... 我的问题是如何在用户输入单一格式时转换为其他两种格式.. 我有转换逻辑.. 。 请帮我...谢谢...
什么是这里的问题少年,从EditText上采取TXT,在无线电选择上,U已经有对话的逻辑,将它转换并再次显示在同一个Edittext中。你想从我们那里得到什么? – AAnkit 2013-02-18 07:59:35
但我有三种格式的六种不同的转换... 文本到十二月,文本到十六进制,十二月到文本,十二进制到十六进制,十六进制到十二进制,十六进制到文本。 当用户选择单选按钮,那么这些不同的功能如何知道它从目标格式转换成哪种格式... – 2013-02-18 08:04:13
转换时设置一些标志。检查标志的条件,同时将 – Deepzz 2013-02-18 08:10:44