小编Anu*_*_07的帖子

在Nexus 7平板电脑中打开相机

我在android中开发了一个Camera应用程序.它使用表面视图捕获图像.下面是我用来打开相机的代码

try {
            // attempt to get a Front Camera instance
            c = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            System.out
                    .println("fail to connect to Front Camera");
        }
        if (c == null) {
            try {
                // attempt to get a Back Camera instance
                c = Camera.open(1);
            } catch (Exception e) {
                // TODO: handle exception
                System.out
                        .println("fail to connect to Camera   with      id   =   1");
            }
        }
        if (c == null) {
            try {
                // attempt …
Run Code Online (Sandbox Code Playgroud)

android nexus-7

6
推荐指数
1
解决办法
4056
查看次数

RadioGroup只有一个选定的项目

我想RadioGroup在图像中制作一个 .我希望一次只RadioButton检查一个.

这就是我做到这一点的原因.

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <RadioButton
            android:id="@+id/radio1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radio1" />

        <RadioButton
            android:id="@+id/radio2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radio2" />
    </RadioGroup>

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <RadioButton
            android:id="@+id/radio3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radio3" />

        <RadioButton
            android:id="@+id/radio4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/radio4" />
    </RadioGroup>
</RadioGroup>
Run Code Online (Sandbox Code Playgroud)

这是图像

我想要的是

但是通过使用它我可以从每一行中选择任何一个,即可以选择2个项目.像这样:

在此输入图像描述

请帮我...

android radio-group radio-button

3
推荐指数
1
解决办法
1万
查看次数

让我的应用程序只运行应用程序

我正在制作一个Android应用程序,我希望它将是唯一运行的应用程序.我的应用程序运行时,没有其他应用程序可以运行 如何才能做到这一点?

提前致谢.

android

-2
推荐指数
1
解决办法
92
查看次数

标签 统计

android ×3

nexus-7 ×1

radio-button ×1

radio-group ×1