Why shouldn't I use System.out.println() in android

后端 未结 7 1132
无人共我
无人共我 2020-11-29 07:45

In the Android Open Source Project\'s code style, it states that we shouldn\'t use System.out.println() but I don\'t understand why. Can anyone explain? What sh

7条回答
  •  心在旅途
    2020-11-29 07:50

    Log is the best way to trace our android project
    like following code...
    it will help u...
    just look in DDMS logCat that how exactly project is build...
    requirement... android.utils.Log; package is used..

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    for(int i=0;i {
    Log.e("i = ",""+i);
    Log.v("i = ",""+i);
    Log.i("i = ",""+i);
    Log.w("i = ",""+i);
    Log.d("i = ",""+i);
    }
    }

    i hope it will help u

提交回复
热议问题