Skip to content

Instantly share code, notes, and snippets.

@takashi1975
Created December 21, 2014 10:34
Show Gist options
  • Save takashi1975/4df672f5a774aa9ffeaf to your computer and use it in GitHub Desktop.
Save takashi1975/4df672f5a774aa9ffeaf to your computer and use it in GitHub Desktop.
Android ... Activity以外のクラスからUIスレッドを実行 (Cocos2d-x前提)
//Activityを取得
Activity actitivy = (Activity)org.cocos2dx.cpp.AppActivity.getContext();
{
//UIスレッドで処理
actitivy.runOnUiThread(new Runnable() {
@Override
public void run(){
Log.d("xxx class" , "test");
//ここで処理
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment