fork download
  1. class main
  2. {
  3. /*
  4.   描画する絵を選択する処理
  5.   int i = checkInputKey(); //入力されたキー番号を取得
  6.  
  7.   */
  8. HandlerThread tc = new HandlerThread("tc"); // カレントスレッド名を渡す
  9. tc.start(); // Thread起動
  10. Runnnaburu r = new Runnnaburu(tc);
  11. new Handler().post(r);
  12. }
  13.  
  14. public class Runnnaburu implements Runnable {
  15.  
  16. HandlerThread ht;
  17.  
  18. public Runnnaburu(HandlerThread ht) {
  19. this.ht = ht;
  20. }
  21.  
  22. @Override
  23. public void run() {
  24. Log.d(TAG, "test2");
  25. Handler hi = new Handler(ht.getLooper());
  26. Log.d(TAG, "test3");
  27. hi.post(new Runnable() {
  28. public void run() {
  29. Log.d(TAG, "test4");
  30. }
  31. });
  32. }
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:9: <identifier> expected
        tc.start(); // Thread??
                ^
Main.java:11: illegal start of type
        new Handler().post(r);
        ^
Main.java:11: ';' expected
        new Handler().post(r);
           ^
Main.java:11: illegal start of type
        new Handler().post(r);
                   ^
Main.java:11: <identifier> expected
        new Handler().post(r);
                    ^
Main.java:11: ';' expected
        new Handler().post(r);
                     ^
Main.java:11: invalid method declaration; return type required
        new Handler().post(r);
                      ^
Main.java:11: <identifier> expected
        new Handler().post(r);
                            ^
8 errors
stdout
Standard output is empty