小编mar*_*f73的帖子

如何从不同的LinearLayouts分组RadioButton?

我想知道是否有可能将每个单独RadioButton的组合在一起,RadioGroup 保持相同的结构.我的结构看起来像这样:

  • LinearLayout_main
    • LinearLayout_1
      • RadioButton1
    • LinearLayout_2
      • RadioButton2
    • LinearLayout_3
      • RadioButton3

如你所见,现在每个人RadioButton都是不同的孩子LinearLayout.我尝试使用下面的结构,但它不起作用:

  • radioGroup中
    • LinearLayout_main
      • LinearLayout_1
        • RadioButton1
      • LinearLayout_2
        • RadioButton2
      • LinearLayout_3
        • RadioButton3

android radio-group radio-button android-linearlayout

84
推荐指数
8
解决办法
4万
查看次数

从Android Asset文件夹中读取xml文件

我正在尝试从assets文件夹中读取相同的文件" xmlfile.xml ",并从SD卡sdcard/download /中读取另一个副本.

我可以从SD卡读取:

  • 正确的回归真实
  • Esite Return True

我无法从Assets文件夹中读取:

  • 不正确的返回错误
  • Esite返回错误

这段代码不适用

        File source = new File("file:///android_asset/xmlfile.xml");
        boolean unfile = source.isFile();
        boolean Esiste = source.exists();

        try
        {
          // todo
        } catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

这段代码工作

        File source = new File("/sdcard/" + "download" + "/" + "xmlfile.xml");
        boolean unfile = source.isFile();
        boolean Esiste = source.exists();

        try
        {
          // todo
        } catch (Exception e)
        { …
Run Code Online (Sandbox Code Playgroud)

xml android android-assets

8
推荐指数
2
解决办法
2万
查看次数

res值字符串中的错误"Locale它缺少翻译"

在我的项目中,我收到一个错误,无法让我编译.据报道,作为示例: 描述资源路径位置类型区域设置它缺少翻译:foo,htmlsource1,htmlsource_old values-it/Android_coll/res line 1 Android Lint问题

"foo,htmlsource1,htmlsource_old"是旧的字符串,现在不再位于res-> values-it文件夹中.更具体地说,它们不再存在于整个项目中

我试过了:

  • 关闭并打开项目.

  • 关闭并打开Eclipse(indingo)

  • 清理项目(项目 - >清洁)

  • 从文件夹值复制文件string.xml并将其复制到文件夹值-it

但我仍然有相同的错误信息.

谢谢马克

android

4
推荐指数
2
解决办法
7011
查看次数

如何从数组字符串[]填充Spinner

如何从数组字符串[]填充微调器

例:

String [] items = new String [] {"uno","due","tre"};

sp =(Spinner)findViewById(R.id.spinner);
sp << --- ADD items Array

谢谢

马尔科

arrays string android android-spinner

0
推荐指数
1
解决办法
6954
查看次数