小编신승빈*_*신승빈的帖子

当我尝试在 android studio 中调试时陷入收集数据的困境

我试图通过单例模式编写代码。

这是我的主要活动。

public class MainActivity extends AppCompatActivity {

public static MainActivity activity;
public TouchSensor touchSensor;
public SurfaceViewThread surfaceViewThread;
public TriggerChecker triggerChecker;

public Physics physics;

//public static Handler mHandler = new Handler();

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    activity = this;
    surfaceViewThread = SurfaceViewThread.getInstance();
    touchSensor = TouchSensor.getInstance();
    triggerChecker = TriggerChecker.getInstance();
    physics = Physics.getInstance();

    touchSensor.start();
    triggerChecker.start();
    physics.start();
    //surfaceViewThread is already started.

    activity.setContentView(surfaceViewThread);
}
Run Code Online (Sandbox Code Playgroud)

这是我尝试通过单例模式编写的代码。

public class SurfaceViewThread extends SurfaceView implements Runnable, SurfaceHolder.Callback {

private static SurfaceViewThread surfaceViewThread = new …
Run Code Online (Sandbox Code Playgroud)

java debugging android android-studio

27
推荐指数
3
解决办法
1万
查看次数

标签 统计

android ×1

android-studio ×1

debugging ×1

java ×1