저는 Android 앱 개발에 익숙하지 않으므로 나와 함께하십시오. Google Play 서비스에서 GPS 위치를 가져온 다음 블루투스를 통해 데이터를 브로드 캐스팅하는 앱을 작성 중입니다. 위치를 얻는 LocationActivity 및 데이터를 브로드 캐스트하는 AdvertiseActivity이 있습니다.오류 : 심볼 클래스를 찾을 수 없습니다. AdvertiseActivity
내 문제는 내가 안드로이드 애플 리케이션에서 파일 구조를 이해하는 데 어려움을 겪고있다. 그래서 나는 나의 이해 부족이 왜 내가 오류를 얻고 있는지 의심한다.
@Override
public void onLocationReceived(Location location) {
Intent i = new Intent(LocationActivity.this, AdvertiseActivity.class) //problem is here
.putExtra("latitude", location.getLatitude());
startActivity(i);
}
왜 컴파일러는 AdvertiseActivity.class을 찾을 수 없습니다 : 여기
오류가 LocationActivity의 조각인가? 내 매니페스트에 문제가 있습니까?<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity android:name="com.android.app.LocationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.android.app.AdvertiseActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
이 도와주세요. 감사! 당신은
주요 피하여 매니페스트로이 개 활동을 사용하는
두 가지 활동에 android.intent.action.MAIN을 사용하고 있고 둘 중 하나를 제거하면 제대로 작동합니다. –