class main
{
/*
描画する絵を選択する処理
int i = checkInputKey(); //入力されたキー番号を取得
*/
ThreadClass tc = new ThreadClass("tc"); //カレントスレッド名を渡す
tc.setDrawPattern(i); //描画するパターンiを渡す
tc.start(); //Thread起動
}
//スレッド
public class ThreadClass extends HandlerThread
{
{
super(s);
}
@Override
public void run()
{
println("test1");
println
(Thread.
currentThread().
getName()); //tcが表示される。 super.run(); // ←こいつがいるとここで止まる(フリーズはExceptionではキャッチされない)
//Looper.prepare(); // ←superがいない時に有効化
println("test2");
Handler hi = new Handler(this.getLooper());
/* this.getLooperでは、呼び出した際に止まってしまう
Looper.getMainLooper() だと正常に描画されるが、描画中main部分が動作不能となる
Looper.myLooper() だと、動作はするがhi.postのrun()が起動せず終わってしまう
(myLooper()の時は、Looper.prepare()を有効化させないとNullPointer)
何も書かなければmyLooper同様な動作をする
*/
println("test3");
public void run () {
println("test4");
//描画処理
}
});
}
}
Y2xhc3MgbWFpbgp7CiAgLyoKICAgIOaPj+eUu+OBmeOCi+e1teOCkumBuOaKnuOBmeOCi+WHpueQhgogICAgaW50IGkgPSBjaGVja0lucHV0S2V5KCk7ICAgIC8v5YWl5Yqb44GV44KM44Gf44Kt44O855Wq5Y+344KS5Y+W5b6XCiAKICAqLwrjgIBUaHJlYWRDbGFzcyB0YyA9IG5ldyBUaHJlYWRDbGFzcygidGMiKTsgICAgICAvL+OCq+ODrOODs+ODiOOCueODrOODg+ODieWQjeOCkua4oeOBmQogIHRjLnNldERyYXdQYXR0ZXJuKGkpOyAvL+aPj+eUu+OBmeOCi+ODkeOCv+ODvOODs2njgpLmuKHjgZkK44CAdGMuc3RhcnQoKTsgICAgICAgICAgLy9UaHJlYWTotbfli5UKfQogCi8v44K544Os44OD44OJCnB1YmxpYyBjbGFzcyBUaHJlYWRDbGFzcyBleHRlbmRzIEhhbmRsZXJUaHJlYWQKewogIFRocmVhZENsYXNzKFN0cmluZyBzKQogIHsKICAgIHN1cGVyKHMpOwogIH0K44CAQE92ZXJyaWRl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CA44CAaGkucG9zdChuZXcgUnVubmFibGUoKSB7CuOAgOOAgOOAgHB1YmxpYyB2b2lkIHJ1biAoKSB7CiAgICAgICAgcHJpbnRsbigidGVzdDQiKTsK44CA44CA44CA44CALy/mj4/nlLvlh6bnkIYK44CA44CA44CAfQrjgIDjgIB9KTsK44CAfQogCn0=
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
?@Override
^
Main.java:20: ';' expected
?@Override
^
Main.java:21: illegal character: \12288
?public void run()
^
Main.java:22: illegal character: \12288
?{
^
Main.java:37: illegal character: \12288
??hi.post(new Runnable() {
^
Main.java:37: illegal character: \12288
??hi.post(new Runnable() {
^
Main.java:37: ';' expected
??hi.post(new Runnable() {
^
Main.java:38: illegal character: \12288
???public void run () {
^
Main.java:38: illegal character: \12288
???public void run () {
^
Main.java:38: illegal character: \12288
???public void run () {
^
Main.java:38: <identifier> expected
???public void run () {
^
Main.java:38: ';' expected
???public void run () {
^
Main.java:38: invalid method declaration; return type required
???public void run () {
^
Main.java:40: illegal character: \12288
????//????
^
Main.java:40: illegal character: \12288
????//????
^
Main.java:40: illegal character: \12288
????//????
^
Main.java:40: illegal character: \12288
????//????
^
Main.java:41: illegal character: \12288
???}
^
Main.java:41: illegal character: \12288
???}
^
Main.java:41: illegal character: \12288
???}
^
Main.java:42: illegal character: \12288
??});
^
Main.java:42: illegal character: \12288
??});
^
Main.java:43: illegal character: \12288
?}
^
31 errors