오류가 발생합니다. OnClickListener 객체를 추가 할 수 없습니다. 이것은 다음 코드입니다. 내가 mFan OnClickListener를 개체에 오류가 직면하고Android에 OnClickListener 객체를 추가하는 방법은 무엇입니까?
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
Activity act;
View rootView = inflater.inflate(R.layout.abc, container, false);
TextView tt=(TextView) rootView.findViewById(R.id.txt);
Button button=(Button) rootView.findViewById(R.id.btn1);
button.setOnClickListener(mFan); // Here i am getting the error //
View.OnClickListener mFan = new OnClickListener()
{
public void onClick(View v)
{
}
};
}
는
는 내가 mFan의 오류를 얻고있다그래서, 나 좀 도와주세요 변수
에 해결 될 수없는, 어떤 날을 제안 좋은 해결책.
고마워요.하지만 두 번째 옵션이 올바르게 작동합니다. 다시 한번 감사드립니다. – animation123