Removed unnecessary reference to activity.
This commit is contained in:
parent
62be337268
commit
5311d374d2
2 changed files with 14 additions and 5 deletions
|
@ -1,11 +1,13 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
|
@ -26,10 +28,17 @@ public class LiveUpdatesFragment extends Fragment {
|
|||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_live_updates, container, false);
|
||||
View view = inflater.inflate(R.layout.fragment_live_updates, container, false);
|
||||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
View header = inflater.inflate(R.layout.live_updates_header, listView, false);
|
||||
listView.addHeaderView(header);
|
||||
return view;
|
||||
}
|
||||
|
||||
private static class LiveUpdatesAdapter extends ArrayAdapter<Object> {
|
||||
|
||||
public LiveUpdatesAdapter(Context context, int resource, Object[] objects) {
|
||||
super(context, resource, objects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
if(current == null || current.getStatus() == AsyncTask.Status.FINISHED ||
|
||||
current.isCancelled() || current.getResult() != null) {
|
||||
asyncLoader = new LoadLocalIndexTask();
|
||||
asyncLoader.execute(getActivity());
|
||||
asyncLoader.execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,12 +277,12 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
}
|
||||
|
||||
|
||||
public class LoadLocalIndexTask extends AsyncTask<Activity, LocalIndexInfo, List<LocalIndexInfo>> {
|
||||
public class LoadLocalIndexTask extends AsyncTask<Void, LocalIndexInfo, List<LocalIndexInfo>> {
|
||||
|
||||
private List<LocalIndexInfo> result;
|
||||
|
||||
@Override
|
||||
protected List<LocalIndexInfo> doInBackground(Activity... params) {
|
||||
protected List<LocalIndexInfo> doInBackground(Void... params) {
|
||||
LocalIndexHelper helper = new LocalIndexHelper(getMyApplication());
|
||||
return helper.getLocalIndexData(this);
|
||||
}
|
||||
|
@ -888,7 +888,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
LocalIndexInfoViewHolder viewHolder;
|
||||
if (convertView == null) {
|
||||
LayoutInflater inflater = LayoutInflater.from(ctx);
|
||||
convertView = inflater.inflate(net.osmand.plus.R.layout.local_index_list_item, parent, false);
|
||||
convertView = inflater.inflate(R.layout.local_index_list_item, parent, false);
|
||||
viewHolder = new LocalIndexInfoViewHolder(convertView);
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue