1
根据图库的位置,一个或另一个edittext将获得焦点。虽然我可以做到这一点,但行为的图库会崩溃:当图库运行位置并将焦点放在edittext上时,图库的速度会崩溃。看起来画廊太慢,无法按时收到请求。行为图库在调用requestFocus时崩溃
我还没有找到关于它的任何重要信息。
galleryView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(
@SuppressWarnings("rawtypes") AdapterView adapterView,
View view, int pos, long l) {
if (pos == 0) {
pie_foto_1.post(new Runnable() {
public void run() {
pie_foto_1.requestFocus();
}
});
}
if (pos == 1) {
pie_foto_2.post(new Runnable() {
public void run() {
pie_foto_2.requestFocus();
}
});
}
if (pos == 2) {
pie_foto_3.post(new Runnable() {
public void run() {
pie_foto_3.requestFocus();
}
});
pie_foto_1.setVisibility(View.INVISIBLE);
pie_foto_2.setVisibility(View.INVISIBLE);
pie_foto_3.setVisibility(View.VISIBLE);
}
}
public void onNothingSelected(
@SuppressWarnings("rawtypes") AdapterView adapterView
) {
}
});