Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 1.请求焦点(); //Log.d(“popi”,“list words”+arrayList.get(position)); //当前=viewHolder.tv1; //当前.setBackgroundResource(R.drawable.focusedText); //单击_pos=posizition; // } }否则{ Animation shake=AnimationUtils.loadAnimation(上下文,R.anim.shake); 当前编辑文本。开始动画(抖动); 当前_edittext.setText(“”); } } Log.d(“pendrive”,“适配器单击类”+键盘单词.get(i)+“current”+单击位置); } }); //对于(int i=0;i0){ // //Log.d(“thanaser”,“可见的单个位置”); // // } // // } final EditText current_EditText=getCurrentEditText(); if(当前编辑文本!=null){ 当前_edittext.addTextChangedListener(新的TextWatcher(){ @凌驾 更改前的公共无效(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void onTextChanged(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void PostTextChanged(可编辑){ if(当前_edittext.getText().toString().length()>0){ Log.d(“hdjhiu”,“文本更改”); } } }); } 返回视图; }_Java_Android_Baseadapter - Fatal编程技术网

Java 1.请求焦点(); //Log.d(“popi”,“list words”+arrayList.get(position)); //当前=viewHolder.tv1; //当前.setBackgroundResource(R.drawable.focusedText); //单击_pos=posizition; // } }否则{ Animation shake=AnimationUtils.loadAnimation(上下文,R.anim.shake); 当前编辑文本。开始动画(抖动); 当前_edittext.setText(“”); } } Log.d(“pendrive”,“适配器单击类”+键盘单词.get(i)+“current”+单击位置); } }); //对于(int i=0;i0){ // //Log.d(“thanaser”,“可见的单个位置”); // // } // // } final EditText current_EditText=getCurrentEditText(); if(当前编辑文本!=null){ 当前_edittext.addTextChangedListener(新的TextWatcher(){ @凌驾 更改前的公共无效(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void onTextChanged(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void PostTextChanged(可编辑){ if(当前_edittext.getText().toString().length()>0){ Log.d(“hdjhiu”,“文本更改”); } } }); } 返回视图; }

Java 1.请求焦点(); //Log.d(“popi”,“list words”+arrayList.get(position)); //当前=viewHolder.tv1; //当前.setBackgroundResource(R.drawable.focusedText); //单击_pos=posizition; // } }否则{ Animation shake=AnimationUtils.loadAnimation(上下文,R.anim.shake); 当前编辑文本。开始动画(抖动); 当前_edittext.setText(“”); } } Log.d(“pendrive”,“适配器单击类”+键盘单词.get(i)+“current”+单击位置); } }); //对于(int i=0;i0){ // //Log.d(“thanaser”,“可见的单个位置”); // // } // // } final EditText current_EditText=getCurrentEditText(); if(当前编辑文本!=null){ 当前_edittext.addTextChangedListener(新的TextWatcher(){ @凌驾 更改前的公共无效(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void onTextChanged(CharSequence CharSequence,int i,int i1,int i2){ } @凌驾 public void PostTextChanged(可编辑){ if(当前_edittext.getText().toString().length()>0){ Log.d(“hdjhiu”,“文本更改”); } } }); } 返回视图; },java,android,baseadapter,Java,Android,Baseadapter,我会通过抛出所有GridLayoutchild视图来实现: public void setFocusOnEditText() { GridLayout layout = findViewById(R.id.layout); layout.getChildCount(); for (int i = 0; i < layout.getChildCount(); i++) { View view = layout.getChildAt(i);

我会通过抛出所有
GridLayout
child
视图来实现:

public void setFocusOnEditText() {
    GridLayout layout = findViewById(R.id.layout);
    layout.getChildCount();
    for (int i = 0; i < layout.getChildCount(); i++) {
        View view = layout.getChildAt(i);
        if (view instanceof EditText && view.getVisibility() == View.VISIBLE) {
            view.requestFocus();
        }
    }
}

使用gridview项目的位置!!!这是否可以添加适配器类?我们谈论的是哪种适配器?如果您想显示适配器代码的一部分,我可以尝试帮助您使用带有自定义键的基本适配器。因此,如果您的基本适配器是扩展了
BaseAdapter
的自定义适配器类,那么您可以在该方法中使用
int position
参数,而不是
I
。它将比这个方法简单得多当我运行代码GridLayout=findviewbyd(R.id.layout)时,没有任何东西能像预期的那样工作;layout.getChildCount();对于(inti=0;ipublic void setFocusOnEditText() { GridLayout layout = findViewById(R.id.layout); layout.getChildCount(); for (int i = 0; i < layout.getChildCount(); i++) { View view = layout.getChildAt(i); if (view instanceof EditText && view.getVisibility() == View.VISIBLE) { view.requestFocus(); } } }
if (convertView instanceof GridLayout) {
   View editText = ((GridLayout) convertView).getChildAt(position);
   if (editText instanceof EditText && editText.getVisibility() == View.VISIBLE) {
      editText.requestFocus();
   }
}