0

logcat ウィンドウにこのエラーが表示されます。ビルド パスにすべての外部 .jar ファイルを追加しました。しかし、Android プロジェクトを実行すると、なぜこれがスローされるのかわかりません。これを解決する方法を教えてください。

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    text1 = (EditText) findViewById(R.id.editText1);
    text2 = (EditText) findViewById(R.id.editText2);

}
public void onClick(View view) throws Exception {
double lat;
    double lon;
    String url = BASE_URL + "sites/" + SITE_ID + "/stations/" + STATION_MAC + "/";
    ClientResource itsClient = new ClientResource(url);
    itsClient.setChallengeResponse(ChallengeScheme.HTTP_BASIC, USERNAME, PASSWORD);
    // Retrieve and parse the JSON representation
    JsonRepresentation jsonRep = new JsonRepresentation(itsClient.get());
    JSONObject jsonObj = jsonRep.getJsonObject();
    // Output results
    lat=jsonObj.getJSONObject("loc").getDouble("lat");
    lon=jsonObj.getJSONObject("loc").getDouble("lng");
    switch (view.getId()) {
    case R.id.button1:

        String lats = Double.toString(lat);
        text1.setText(lats);
        String lons = Double.toString(lon);
        text2.setText(lons);
        break;
    }
}

ありがとう!

4

0 に答える 0