我得到了这个:
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
...
View android[] = new View[6];
android[0] = inflater.inflate(R.layout.asd_frag, container, false);
((TextView) android[0].findViewById(R.id.textViewAsd01)).setText("Asd");
((TextView) android[0].findViewById(R.id.game_asd_name_one)).setText("hi");
还有这个
android[1] = inflater.inflate(R.layout.qwe_frag, container, false);
((TextView) android[1].findViewById(R.id.textViewQwe01)).setText("qwe");
((TextView) android[1].findViewById(R.id.game_Qwe_name_two)).setText("bye");
return android;
当我尝试返回这个数组时,我收到一条奇怪的消息:
*Incompatible types
Required android.view.View
Found android.view.View[]*
我基本上只是想给出我的数组。
最佳答案
定义变量时,尝试使用 View[] android
而不是 View android[]
。
这使得它
View[] android = new View[6];
关于java - Android.view.View错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31574439/