Removed unnecessary reference to activity.

This commit is contained in:
GaidamakUA 2015-12-08 10:43:12 +02:00
parent 62be337268
commit 5311d374d2
2 changed files with 14 additions and 5 deletions

View file

@ -1,11 +1,13 @@
package net.osmand.plus.liveupdates; package net.osmand.plus.liveupdates;
import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;
import net.osmand.plus.R; import net.osmand.plus.R;
@ -26,10 +28,17 @@ public class LiveUpdatesFragment extends Fragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { 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); 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; return view;
} }
private static class LiveUpdatesAdapter extends ArrayAdapter<Object> {
public LiveUpdatesAdapter(Context context, int resource, Object[] objects) {
super(context, resource, objects);
}
}
} }

View file

@ -161,7 +161,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
if(current == null || current.getStatus() == AsyncTask.Status.FINISHED || if(current == null || current.getStatus() == AsyncTask.Status.FINISHED ||
current.isCancelled() || current.getResult() != null) { current.isCancelled() || current.getResult() != null) {
asyncLoader = new LoadLocalIndexTask(); 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; private List<LocalIndexInfo> result;
@Override @Override
protected List<LocalIndexInfo> doInBackground(Activity... params) { protected List<LocalIndexInfo> doInBackground(Void... params) {
LocalIndexHelper helper = new LocalIndexHelper(getMyApplication()); LocalIndexHelper helper = new LocalIndexHelper(getMyApplication());
return helper.getLocalIndexData(this); return helper.getLocalIndexData(this);
} }
@ -888,7 +888,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
LocalIndexInfoViewHolder viewHolder; LocalIndexInfoViewHolder viewHolder;
if (convertView == null) { if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(ctx); 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); viewHolder = new LocalIndexInfoViewHolder(convertView);
convertView.setTag(viewHolder); convertView.setTag(viewHolder);
} else { } else {