Commit 782929b0 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

Only check the preferences if we actually have an activity

This avoids a crash if this happens to be called without
an instance of the main activity existing.
Signed-off-by: Martin Storsjö's avatarMartin Storsjö <>
parent a7fbe3bd
......@@ -121,7 +121,10 @@ public class LibVLC {
Log.v(TAG, "Initializing LibVLC");
if (!mIsInitialized) {
boolean useIomx = PreferenceManager.getDefaultSharedPreferences(MainActivity.getInstance()).getBoolean("enable_iomx", false);
MainActivity activity = MainActivity.getInstance();
boolean useIomx = false;
if (activity != null)
useIomx = PreferenceManager.getDefaultSharedPreferences(activity).getBoolean("enable_iomx", false);
mIsInitialized = true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment