获取点击事件的视图

时间:2013-03-24 19:46:01

标签: android view get-childitem

对不起我的英文..这是google traductor

我创建(java)例如10 LLseccion。

每个LLseccion内有多个对象(imageview和2 textview)

我想阅读点击布局的第一个textview

        LinearLayout LLseccion = new LinearLayout(getApplicationContext());
        LLseccion.setOrientation(LinearLayout.HORIZONTAL);
        LLseccion.setId(i);
        LLseccion.setClickable(true);

        LLseccion.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {



            }
        });



                TextView tvBIG=new TextView(getApplicationContext());
                tvBIG.setText("i want read this");
                tvBIG.setTypeface(FontNormal);
                tvBIG.setTextSize(bigSize);
                tvBIG.setTextColor(getResources().getColor(R.color.GREEN));
                tvBIG.setSingleLine(true);
                LLseccion.addView(tvBIG);

                    TextView tvSMALL=new TextView(getApplicationContext());
                    tvSMALL.setText("other text");
                    tvSMALL.setTypeface(FontNormal);
                    tvSMALL.setTextSize(smallSize);
                    tvSMALL.setTextColor(getResources().getColor(R.color.GREEN));
                    tvSMALL.setPadding(30, 0, 0, 0);
                    tvSMALL.setSingleLine(true);
                    LLseccion.addView(tvSMALL);

0 个答案:

没有答案