main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:ads="http://schemas.android.com/apk/res/china.co.simplic"
android:id="@+id/parent" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView" <---요기서 빨간줄 쫙!!!
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="a14dc756bb804a6"
ads:adSize="BANNER"
android:layout_alignParentTop="true" />
</LinearLayout>
</RelativeLayout>
attrs.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.google.ads.AdView">
<attr name="adSize">
<enum name="BANNER" value="1" />
<enum name="IAB_MRECT" value="2" />
<enum name="IAB_BANNER" value="3" />
<enum name="IAB_LEADERBOARD" value="4" />
</attr>
<attr name="adUnitId" format="string" />
</declare-styleable>
</resources>
JAVA 파일
package com.korea_music_list;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.LinearLayout;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;
public class korea_music_list extends Activity {
private static final String MY_AD_UNIT_ID = "a14e0f5405d9fd8";
private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID); <--여기서 파란줄 쫙!!
LinearLayout layout = (LinearLayout)findViewById(R.id.advertisement1);
layout.addView(adView);
adView.loadAd(new AdRequest());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void onDestroy(){
adView.destroy();
super.onDestroy();
}
}
설마 라이브러리 추가 안한건.