我可以发送整个项目或所需的文件,请帮助我,这是我的程序
`package com.parkaspot.najeeb.project;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.support.v4.app.ActivityCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.github.ivbaranov.mli.MaterialLetterIcon;
import java.util.ArrayList;
import java.util.Random;
public class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder>{
private Context context;
private ArrayList<RecentData> mArrayList;
private LayoutInflater inflater;
private int[] mMaterialColors;
Location networkLocation;
Double lati,lngi;
private static final Random RANDOM = new Random();
public RecentAdapter(Context context, ArrayList<RecentData> list) {
this.context = context;
this.mArrayList = list;
inflater = LayoutInflater.from(context);
mMaterialColors = context.getResources().getIntArray(R.array.colors);
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
boolean networkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (networkEnabled) {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;
}
networkLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
}
if (networkLocation!=null){
lati = networkLocation.getLatitude();
lngi = networkLocation.getLongitude();
}
}
兄弟们请帮助我,我已经花了3天的时间来解决此问题,但是我无法对Android Programmking进行新手学习,并且正在做一个大学项目,请帮助我修复它
一只萌萌小番薯
相关分类