Commit afaf034c authored by Adrien Maglo's avatar Adrien Maglo

History: fix a crash during item layout initialization

parent 32576055
......@@ -29,6 +29,7 @@ import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.WeakHandler;
import org.videolan.vlc.gui.audio.AudioUtil;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Message;
import android.util.Log;
......@@ -45,8 +46,8 @@ public class HistoryAdapter extends BaseAdapter {
private LayoutInflater mInflater;
private LibVLC mLibVLC;
public HistoryAdapter() {
mInflater = LayoutInflater.from(VLCApplication.getAppContext());
public HistoryAdapter(Context context) {
mInflater = LayoutInflater.from(context);
try {
mLibVLC = LibVLC.getInstance();
} catch (LibVlcException e) {
......
......@@ -49,7 +49,7 @@ public class HistoryFragment extends SherlockListFragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHistoryAdapter = new HistoryAdapter();
mHistoryAdapter = new HistoryAdapter(getActivity());
Log.d(TAG, "HistoryFragment()");
}
......
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