logoLinear1 = new LinearLayout(this);
logoLinear1.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
logoLinear1.setOrientation(LinearLayout.VERTICAL);
logoLinear1.setId(111);

textView = new TextView(this);
textView.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
logoLinear1.addView(textView);

adapter = new ArrayAdapter<String>(this,logoLinear1.getId(),strs);
08-17 01:31:08.695: ERROR/AndroidRuntime(559): android.content.res.Resources$NotFoundException: Resource ID #0x6f
这是为什么呢,,

解决方案 »

  1.   

    logoLinear1.getId()
    这个id他根本在R.java找不到他的实现里
      view = mInflater.inflate(resource, parent, false);
    看看
    文档描述LayoutInflater的作用
    This class is used to instantiate layout XML file into its corresponding View objects明白了吧
      

  2.   

    其实我是不想用xml添加布局,所以这样想的,,不过我还是没有实现,,
    logoLinear1.getId()
    这个id他根本在R.java找不到
    的确是这样,,
    那要是我要使用ArrayAdapter 且又不使用xml,添加布局,,那ArrayAdapter(this,R.layout.main,strs);R.layout.main这个能不能用自己写的布局替换掉呢,,提个好的方法。