2013년 7월 3일 수요일

PrivateCommand란?

reference를 보자
http://developer.android.com/reference/android/view/inputmethod/InputMethodSession.html

public abstract void appPrivateCommand (String action, Bundle data)
Process a private command sent from the application to the input method. This can be used to provide domain-specific features that are only known between certain input methods and their clients.
어플리케이션에서 InputMethod로 보내는 private command이다. action에는 command의 이름을 넣고 Bundle에 데이터를 넣어 전달한다. action은 단지 String일 뿐이므로 conflicting에 주의해서 만들도록 한다.
InputMethod에서는 InputMethodService.onAppPrivateCommand(String, Bundle)를 통해 받을 수 있다.

반대로 InputMethod에서 editor로 private command를 보낼 때는 InputConnection의

public abstract boolean performPrivateCommand (String action, Bundle data)
를 사용한다.

Bundle(A mapping from String values to various Parcelable types.)은 대부분의 타입들을 지원하며, key를 통해 put/get을 사용한다.

댓글 없음: