私はロケーションアプリを実行しようとしていますが、現在トラブルシューティングフェーズにあります。私は私の最後の2つの問題に取り掛かっています、そしてそれらは両方ともR.blahblahに関係しています。mainがフィールドではないか、解決できず、同じメッセージですが、mainの代わりにmapviewが使用されていることを示しています。以下は私のインポートと問題があるコードの行です。
コード:
setContentView(R.layout.main);
mapview = (MapView)findViewById(R.id.mapview);
輸入:
import android.R;
import android.R.layout;
import android.R.id;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
私はすべてを試しました。私は人々がandroid.Rを取り出すように言い続けていることを知っていますが、それはR.layoutとR.idがjarファイルにある場所です。フォルダを右クリックしてコードを検証しました。Project/Cleanに行ってそれを行いました。運がない。助けてください?そして、これは私の最初の投稿なので、フォーマットが間違っていると申し訳ありません。よろしくお願いします。これが私のmain.xmlです
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Waiting for location..."
android:id="@+id/lblLocationInfo"
/>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0vFrUOhHMkbahT9zXqiz_DuNVWfPqlEyqcO8ftg"
/>
</LinearLayout>