class main
{
/*
描画する絵を選択する処理
int i = checkInputKey(); //入力されたキー番号を取得
*/
ThreadClass tc = new ThreadClass("tc"); //カレントスレッド名を渡す
tc.setDrawPattern(i); //描画するパターンiを渡す
tc.start(); //Thread起動
}
//スレッド
public class ThreadClass
extends HandlerThread
implements Runnable {
{
super(s);
}
public void run()
{
println("test1");
super.run(); // ←こいつがいるとここで止まる
//Looper.prepare();
println("test2");
Handler hi = new Handler(this.getLooper());
//※起動してみたら↑で止まる
//tc.getLooper()を外せば止まらずプログラムは走るが、↓のRunが起動せず終了する
//Looper.getMainLooper() だと正常に描画されるが、描画中main部分が動作不能となる
//Looper.myLooper() だと、動作はするがhi.postのrun()が起動せず終わってしまう
println("test3");
public void run () {
println("test4");
//描画処理
}
});
}
}
Y2xhc3MgbWFpbgp7CiAgLyoKICAgIOaPj+eUu+OBmeOCi+e1teOCkumBuOaKnuOBmeOCi+WHpueQhgogICAgaW50IGkgPSBjaGVja0lucHV0S2V5KCk7ICAgIC8v5YWl5Yqb44GV44KM44Gf44Kt44O855Wq5Y+344KS5Y+W5b6XCiAKICAqLwrjgIBUaHJlYWRDbGFzcyB0YyA9IG5ldyBUaHJlYWRDbGFzcygidGMiKTsgICAgICAvL+OCq+ODrOODs+ODiOOCueODrOODg+ODieWQjeOCkua4oeOBmQogIHRjLnNldERyYXdQYXR0ZXJuKGkpOyAvL+aPj+eUu+OBmeOCi+ODkeOCv+ODvOODs2njgpLmuKHjgZkK44CAdGMuc3RhcnQoKTsgICAgICAgICAgLy9UaHJlYWTotbfli5UKfQogCi8v44K544Os44OD44OJCnB1YmxpYyBjbGFzcyBUaHJlYWRDbGFzcyBleHRlbmRzIEhhbmRsZXJUaHJlYWQgaW1wbGVtZW50cyBSdW5uYWJsZQp7CiAgVGhyZWFkQ2xhc3MoU3RyaW5nIHMpCiAgewogICAgc3VwZXIocyk7CiAgfQrjgIAK44CAcHVibGljIHZvaWQgcnVuKCkK44CAewogICAgcHJpbnRsbigidGVzdDEiKTsKICAgIHN1cGVyLnJ1bigpOyAvLyDihpDjgZPjgYTjgaTjgYzjgYTjgovjgajjgZPjgZPjgafmraLjgb7jgosKICAgIC8vTG9vcGVyLnByZXBhcmUoKTsKICAgIHByaW50bG4oInRlc3QyIik7CiAgICBIYW5kbGVyIGhpID0gbmV3IEhhbmRsZXIodGhpcy5nZXRMb29wZXIoKSk7IAogICAgLy/igLvotbfli5XjgZfjgabjgb/jgZ/jgonihpHjgafmraLjgb7jgosKICAgIC8vdGMuZ2V0TG9vcGVyKCnjgpLlpJbjgZvjgbDmraLjgb7jgonjgZrjg5fjg63jgrDjg6njg6Djga/otbDjgovjgYzjgIHihpPjga5SdW7jgYzotbfli5XjgZvjgZrntYLkuobjgZnjgosK44CA44CALy9Mb29wZXIuZ2V0TWFpbkxvb3BlcigpIOOBoOOBqOato+W4uOOBq+aPj+eUu+OBleOCjOOCi+OBjOOAgeaPj+eUu+S4rW1haW7pg6jliIbjgYzli5XkvZzkuI3og73jgajjgarjgosKICAgIC8vTG9vcGVyLm15TG9vcGVyKCkg44Gg44Go44CB5YuV5L2c44Gv44GZ44KL44GMaGkucG9zdOOBrnJ1bigp44GM6LW35YuV44Gb44Ga57WC44KP44Gj44Gm44GX44G+44GGCiAgICBwcmludGxuKCJ0ZXN0MyIpOwrjgIDjgIBoaS5wb3N0KG5ldyBSdW5uYWJsZSgpIHsK44CA44CA44CAcHVibGljIHZvaWQgcnVuICgpIHsKICAgICAgICBwcmludGxuKCJ0ZXN0NCIpOwrjgIDjgIDjgIDjgIAvL+aPj+eUu+WHpueQhgrjgIDjgIDjgIB9CuOAgOOAgH0pOwrjgIB9CiAKfQ==
Main.java:8: illegal character: \12288
?ThreadClass tc = new ThreadClass("tc"); //????????????
^
Main.java:8: ';' expected
?ThreadClass tc = new ThreadClass("tc"); //????????????
^
Main.java:8: <identifier> expected
?ThreadClass tc = new ThreadClass("tc"); //????????????
^
Main.java:9: <identifier> expected
tc.setDrawPattern(i); //????????i???
^
Main.java:9: <identifier> expected
tc.setDrawPattern(i); //????????i???
^
Main.java:10: illegal character: \12288
?tc.start(); //Thread??
^
Main.java:10: ';' expected
?tc.start(); //Thread??
^
Main.java:10: illegal start of type
?tc.start(); //Thread??
^
Main.java:20: illegal character: \12288
?
^
Main.java:21: illegal character: \12288
?public void run()
^
Main.java:22: illegal character: \12288
?{
^
Main.java:30: illegal character: \12288
??//Looper.getMainLooper() ???????????????main??????????
^
Main.java:30: illegal character: \12288
??//Looper.getMainLooper() ???????????????main??????????
^
Main.java:32: ';' expected
println("test3");
^
Main.java:33: illegal character: \12288
??hi.post(new Runnable() {
^
Main.java:33: illegal character: \12288
??hi.post(new Runnable() {
^
Main.java:33: ';' expected
??hi.post(new Runnable() {
^
Main.java:34: illegal character: \12288
???public void run () {
^
Main.java:34: illegal character: \12288
???public void run () {
^
Main.java:34: illegal character: \12288
???public void run () {
^
Main.java:34: <identifier> expected
???public void run () {
^
Main.java:34: ';' expected
???public void run () {
^
Main.java:34: invalid method declaration; return type required
???public void run () {
^
Main.java:36: illegal character: \12288
????//????
^
Main.java:36: illegal character: \12288
????//????
^
Main.java:36: illegal character: \12288
????//????
^
Main.java:36: illegal character: \12288
????//????
^
Main.java:37: illegal character: \12288
???}
^
Main.java:37: illegal character: \12288
???}
^
Main.java:37: illegal character: \12288
???}
^
Main.java:38: illegal character: \12288
??});
^
Main.java:38: illegal character: \12288
??});
^
Main.java:39: illegal character: \12288
?}
^
33 errors