Skip to content

Commit

Permalink
Merge pull request romainguy#7 from pyricau/patch-1
Browse files Browse the repository at this point in the history
Updating the Javadoc to provide an example for an InputMethodService
  • Loading branch information
romainguy committed Sep 7, 2012
2 parents 345f7aa + 1413fd1 commit 98a80bd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/com/android/debug/hv/ViewServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,33 @@
* }
* }
* </pre>
*
* <p>
* In a similar fashion, you can use this API with an InputMethodService:
* </p>
*
* <pre>
* public class MyInputMethodService extends InputMethodService {
* public void onCreate() {
* super.onCreate();
* View decorView = getWindow().getWindow().getDecorView();
* String name = "MyInputMethodService";
* ViewServer.get(this).addWindow(decorView, name);
* }
*
* public void onDestroy() {
* super.onDestroy();
* View decorView = getWindow().getWindow().getDecorView();
* ViewServer.get(this).removeWindow(decorView);
* }
*
* public void onStartInput(EditorInfo attribute, boolean restarting) {
* super.onStartInput(attribute, restarting);
* View decorView = getWindow().getWindow().getDecorView();
* ViewServer.get(this).setFocusedWindow(decorView);
* }
* }
* </pre>
*/
public class ViewServer implements Runnable {
/**
Expand Down

0 comments on commit 98a80bd

Please sign in to comment.