amitshekhariitbhu / Android-Debug-Database

A library for debugging android databases and shared preferences - Make Debugging Great Again
https://outcomeschool.com
Apache License 2.0
8.41k stars 870 forks source link

Make the url of database more persistent #161

Closed Oziomajnr closed 5 years ago

Oziomajnr commented 5 years ago

Is there any way to make the url of the database more persistent? When it is outputed to logcat, it is quickly pushed out of the window by recent logcat outputs. Is there any other way I can view the database url outside logcat?

amitshekhariitbhu commented 5 years ago

Yes, you can use this

public static void showDebugDBAddressLogToast(Context context) {
    if (BuildConfig.DEBUG) {
       try {
            Class<?> debugDB = Class.forName("com.amitshekhar.DebugDB");
            Method getAddressLog = debugDB.getMethod("getAddressLog");
            Object value = getAddressLog.invoke(null);
            Toast.makeText(context, (String) value, Toast.LENGTH_LONG).show();
       } catch (Exception ignore) {

       }
    }
}