Jui*_*iCe 2 user-interface android bluetooth popup
我目前正在制作一个程序,该程序应该提示用户选择它想要连接的某个蓝牙设备.我通过选项菜单在我的代码中设置了它.
我希望它看起来像是BlueTerm的弹出窗口.我实际上有BlueTerm的代码(因为它可以自由查看),但我无法弄清楚如何使窗口显示为弹出而不是全屏视图.这是弹出窗口图片的链接:https://play.google.com/store/apps/details?id = es.pymasde.blueterm&hl = zh-CN
它是在xml文件中完成的吗?因为我在我的XML文件中找不到会导致此错误的文件.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/title_paired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title_paired_devices"
android:visibility="gone"
android:background="#666"
android:textColor="#fff"
android:paddingLeft="5dp" />
<ListView android:id="@+id/paired_devices"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:layout_weight="1" />
<TextView android:id="@+id/title_new_devices" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/title_other_devices" android:visibility="gone" android:background="#666" android:textColor="#fff" android:paddingLeft="5dp" />
<ListView android:id="@+id/new_devices" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stackFromBottom="true" android:layout_weight="2" />
<Button android:id="@+id/button_scan" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/button_scan" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
您必须在AndroidManifest.xml文件中将该活动的主题定义为Theme.Dialog
例:
<activity android:name="AleartMeassage" android:theme="@android:style/Theme.Dialog"></activity>
Run Code Online (Sandbox Code Playgroud)