Implement Thread Android in my class?

后端 未结 2 1680
自闭症患者
自闭症患者 2021-01-25 07:35

I would like to know how to implement a thread in this class to make it safe from the problems of ANR (Application Not Responding)

public class myClass {


    p         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-25 08:04

        Thread thread = new Thread()
        {
            @Override
            public void run()
            {
                myClass rootChecker = new myClass();
                isRooted = rootChecker.isDeviceRooted();
            }
        };
    

提交回复
热议问题