diff --git a/app/build.gradle b/app/build.gradle index 1c90fc7..3fb7265 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,6 +40,6 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -// implementation project(':xlog') - implementation 'com.github.JiangHaiYang01:XLogHelper:0.0.1' + implementation project(':xlog') +// implementation 'com.github.JiangHaiYang01:XLogHelper:0.0.1' } \ No newline at end of file diff --git a/app/src/main/java/com/allens/xloghelper/MainActivity.kt b/app/src/main/java/com/allens/xloghelper/MainActivity.kt index ef2ea2b..714dc78 100644 --- a/app/src/main/java/com/allens/xloghelper/MainActivity.kt +++ b/app/src/main/java/com/allens/xloghelper/MainActivity.kt @@ -11,6 +11,7 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) + //添加日志 add.setOnClickListener { for (i in 1..10) { @@ -24,5 +25,17 @@ class MainActivity : AppCompatActivity() { } } + + //close 之后不能写入 + close.setOnClickListener { + XLogHelper.close() + } + + + //flush 之后 还能够再次写入 + flush.setOnClickListener { + XLogHelper.flush(true) + } + } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index d2251d2..16e41a2 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,18 +1,30 @@