diff --git a/app/src/main/java/com/balsikandar/crashreporter/sample/MainActivity.java b/app/src/main/java/com/balsikandar/crashreporter/sample/MainActivity.java index 0ba97ad..41a2ab3 100644 --- a/app/src/main/java/com/balsikandar/crashreporter/sample/MainActivity.java +++ b/app/src/main/java/com/balsikandar/crashreporter/sample/MainActivity.java @@ -1,16 +1,19 @@ package com.balsikandar.crashreporter.sample; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import com.balsikandar.crashreporter.CrashReporter; +import com.balsikandar.crashreporter.ui.CrashReporterActivity; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { Context context; + Context mContext; @Override protected void onCreate(Bundle savedInstanceState) { @@ -62,11 +65,20 @@ public void run() { context.getResources(); } catch (Exception e) { //log caught Exception - CrashReporter.logException(e, MainActivity.class.getSimpleName()); + CrashReporter.logException(e); } } }).start(); + mContext = this; + findViewById(R.id.crashLogActivity).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(mContext, CrashReporterActivity.class); + startActivity(intent); + } + }); + } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 4b55d7f..4de0308 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -46,38 +46,15 @@ android:textColor="@color/black" android:textSize="14sp" /> - +