How can I resolve this issue of symbol issue?

Here is My Code but I am facing the issue of can not find symbol

package com.example.adeeb.gamecom;

import android.Manifest;

import android.content.pm.PackageManager;

import android.location.LocationListener;

import android.location.LocationManager;

import android.support.v4.app.ActivityCompat;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

Button btnShowLocation;

private static final int REQUEST_CODE_PERMISSION = 2;

String mPermission = Manifest.permission.ACCESS_FINE_LOCATION;

GPSTracker gps;

TextView location;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

try

{

if(ActivityCompat.checkSelfPermission(this,mPermission)!=

MockPackageManager.PERMISSION_GRANTED){

ActivityCompat.requestPermissions(this,new String[]

{mPermission},REQUEST_CODE_PERMISSION);

}

}

catch (Exception e)

{

e.printStackTrace();

}

btnShowLocation = (Button) findViewById(R.id.button);

btnShowLocation.setOnClickListener(new View.OnClickListener(){

public void onClickView(View V)

{

gps = new GPSTacker(MainActivity.this);

location = (TextView) findViewById(R.id.locationtext);

if(((GPSTracker) gps).canGetLocation())

{

double latitude = ((GPSTracker) gps).getLatitude();

double longitude = ((GPSTracker) gps).getLatitude();

location.setText(latitude+" "+longitude);

}

else

{

((GPSTracker) gps).showSettingsAlert();

}

}

});

}

}

this is giving me error

error: cannot find symbol class GPSTracker

error: cannot find symbol variable MockPackageManager

How...

Read More »

By: StackOverFlow - Tuesday, 6 November

Related Posts