With max=0
and min=20
, int a
and/or int b
becomes a negative number-> n<=0
in the LogCat.
Also,
1. In emulator, you will have to pass location lat-long values. Through either Eclipse-DDMS or pass values directly in code (for the purpose of testing the rest of your code.)
for-"..cause i don't know how to use GPS in emulator, so it returns null"
2. In your current code, in the else
part of if(location!=null)
,
final TextView textViewToChange = (TextView) findViewById(R.id.textView1);
textViewToChange.setText("Unable to get weather information.");
TextView text = (TextView) findViewById(R.id.textView1);
Same ...id.textView1
for both- text
and textViewToChange
To convert int to String:
String a = String.valueOf(int value here);
check: http://www.tutorialspoint.com/java/java_string_valueof.htm