2011-08-30 2 views
2

는,이 코드는 잘 지금까지findViewById가 InputMethodService에서 작동하지 않습니다. 어떻게해야합니까? 나는 안드로이드 키보드를 만들려고 해요

package keyboard.rob.com; 

import... 

public class xyz extends InputMethodService 
implements KeyboardView.OnKeyboardActionListener { 

    private LinearLayout mInputView; 

    @Override public View onCreateInputView() { 
     mInputView = (LinearLayout) getLayoutInflater().inflate(R.layout.main, null); 
     return mInputView; 
    } 

... 

하지만 나중에 내가

LinearLayout LinLayBg = (LinearLayout)findViewById(R.id.LL_total); 

단추로 채울 수 있도록하기 위해 노력하고있어 경우에 작동, 그것은 쇼

어떤 아이디어 "*있어서 findViewById를 (INT)는 입력 zyz *에 대한 정의는"? 감사!

답변

6

나는보기의 인스턴스가 아닌에서 findViewById(int id); 메서드를 호출하려고한다고 생각합니다.

시도 :

mInputView.findViewById(R.id.LL_total); 

그것이

+0

덕분에, 일! :) – Roger

+0

듣고 다행 :) – Houcine

3

도움이되기를 바랍니다 당신은 이런 식으로 할 수 있어야 :

View.findViewById(R.id.LL_total); 
관련 문제