Commit c7c63062 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

MediaInfoFragment: simplify, since update() was called only once

parent 275ce179
...@@ -85,16 +85,7 @@ public class MediaInfoFragment extends ListFragment { ...@@ -85,16 +85,7 @@ public class MediaInfoFragment extends ListFragment {
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
update();
}
public void setMediaLocation(String MRL) {
if (MRL == null)
return;
mItem = MediaLibrary.getInstance(getActivity()).getMediaItem(MRL);
}
private void update() {
if (mItem == null) { if (mItem == null) {
// Shouldn't happen, maybe user opened it faster than Media Library could index it // Shouldn't happen, maybe user opened it faster than Media Library could index it
return; return;
...@@ -107,6 +98,12 @@ public class MediaInfoFragment extends ListFragment { ...@@ -107,6 +98,12 @@ public class MediaInfoFragment extends ListFragment {
new Thread(mLoadImage).start(); new Thread(mLoadImage).start();
} }
public void setMediaLocation(String MRL) {
if (MRL == null)
return;
mItem = MediaLibrary.getInstance(getActivity()).getMediaItem(MRL);
}
Runnable mLoadImage = new Runnable() { Runnable mLoadImage = new Runnable() {
@Override @Override
public void run() { public void run() {
......
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