Closed Doomsdayrs closed 4 years ago
I am getting the following error while trying to run this change.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.saha.batchuninstaller/com.saha.batchuninstaller.activities.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
Seems like in this line
private val mPrefs: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext)
applicationContext is null?
Have you tried running your changes in a device?
That should fix it~
Thanks! The code looks good. I just need a couple more changes, and I can merge it to master.
Running Code inspection shows that we have unnecessary safe calls on mEditor. Can you please remove the ? wherever mEditor is read. Those aren't needed.
This isn't related to your change, but would be great if I can merge together. The day and night modes often didn't work properly on this application. Based on this link, seem like replacing applicationContext with this@MainActivity in the AppInfo adapter does the trick. If possible, please change that as well,
In line 130, mAdapter = AppInfoAdapter(applicationContext, mApps) change applicationContext to this@MainActivity
Once done, let me know. I will merge.
:+1:
Merged to master. Thanks for the change!