I am placing a code below, I have created a local Thread and getting Error at the last Closing Braces, Can anybody please sort it out for me.
Thread dt = new Thread(this){
public void run()
{
Looper.prepare();
GetCurrentLocation loc = new GetCurrentLocation(RestaurantFinder.this);
loc.setLocParams();
int counter = 0;
String lat = GetCurrentLocation.getCurrentLatitude();
String lon = GetCurrentLocation.getCurrentLongitude();
while (lat == null && lon == null
&& counter <= 1000)
{
lat = GetCurrentLocation.getCurrentLatitude();
lon = GetCurrentLocation.getCurrentLongitude();
counter = counter + 1;
}
System.out.println("The Latitude are:" + lat);
System.out.println("The Longitude are:"+ lon);
if (lat == null && lon == null)
{
// another alert for location not found
AlertDialog.Builder builder1 = new AlertDialog.Builder(RestaurantFinder.this);
builder1.setTitle("Restaurant Finder");
builder1.setMessage("Unable to find the Current Location");
builder1.setPositiveButton("OK",new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog,int which)
{
dialog.dismiss();
}
});
AlertDialog dialog1 = builder1.create();
dialog1.show();
// dismiss ProgressDialog by Handler
pd.dismiss();
}
else
{
weather();
// dismiss ProgressDialog by Handler
pd.dismiss();
}
}
});<--(Error:Syntax error on token ")", Delete this token)