Commit 14b14166 authored by Edward Wang's avatar Edward Wang

Don't leave the user hanging if LibVLC couldn't be initialized

parent 20303401
......@@ -134,18 +134,25 @@ public class MainActivity extends SherlockFragmentActivity {
listView.setBackgroundColor(Color.parseColor("#1f3f61"));
mMenu.setViewBehind(sidebar);
super.onCreate(savedInstanceState);
/* Get settings */
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
LibVLC.useIOMX(this);
try {
// Start libvlc
// Start LibVLC
LibVLC.getInstance();
} catch (LibVlcException e) {
e.printStackTrace();
super.onCreate(null);
Intent i = new Intent(this, CompatErrorActivity.class);
i.putExtra("runtimeError", true);
i.putExtra("message", "LibVLC failed to initialize (LibVlcException)");
startActivity(i);
finish();
return;
}
super.onCreate(savedInstanceState);
/* Initialize variables */
mInfoLayout = v_main.findViewById(R.id.info_layout);
mInfoProgress = (ProgressBar) v_main.findViewById(R.id.info_progress);
......
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