I am new in java and I am trying to find a simple way to put a dialog after if statement but I am stack. I tried this code but i don't want to create a new class for one dialog.
So I am trying to get a Dialog when I get close to a point, I have a toast as well and I am getting the toast correct.
I didn't include the full code but I can do so if is necessary.
Thx
if(i==3){//this is home
TextView tv4=(TextView)parentActivity.findViewById(R.id.textView4);
tv4.setText("Distance From home is: "+ String.valueOf(distance));
if (distance < 1000) {
AlertDialog.Builder builder1 = new AlertDialog.Builder(parentActivity.getBaseContext());
builder1.setTitle("Alert Dialog");
builder1.setMessage("Write your message here.");
Toast.makeText(parentActivity.getBaseContext(),
"Welcome Home", Toast.LENGTH_LONG).show();
}
}