📜  在 android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1565) - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:20.550000             🧑  作者: Mango

代码示例1
public void onViewCreated(View view, Bundle savedInstanceState) 
{
    int SDK_INT = android.os.Build.VERSION.SDK_INT;
    if (SDK_INT > 8) 
    {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                .permitAll().build();
        StrictMode.setThreadPolicy(policy);
        //your codes here

    }
}