<!-- Screen Design for Photos -->
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="15dip"
android:text="PILIH Gong"
android:textSize="18dip" />
<LinearLayout
android:layout_height="wrap_content"
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:paddingTop="30px">
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3"
android:text="Sasalakan"
android:onClick="clickHandler"></Button>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3.0"
android:text="Nananangon"
android:onClick="clickHandler"></Button>
<Button
android:id="@+id/button3"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3.0"
android:text="Hahambaton" android:onClick="clickHandler"></Button>
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-1812703940655513/5200925381"/>
<LinearLayout
android:layout_height="wrap_content"
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:paddingTop="30px">
<Button
android:layout_width="fill_parent"
android:layout_weight="3"
android:layout_height="wrap_content"
android:id="@+id/button4"
android:text="Hohotukon"
android:onClick="clickHandler"></Button>
<Button
android:layout_width="fill_parent"
android:layout_weight="3.0"
android:layout_height="wrap_content"
android:id="@+id/button5"
android:text="Kukulimpoon"
android:onClick="clickHandler"></Button>
<Button
android:layout_width="fill_parent"
android:layout_weight="3.0"
android:layout_height="wrap_content"
android:id="@+id/button6"
android:text="Tatavag"
android:onClick="clickHandler"></Button>
</LinearLayout>
</LinearLayout>
package my.androidpreneur.gong;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Maingong extends Activity {
private AdView mAdView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maingong);
mAdView.setAdListener(new ToastAdListener(this));
AdView mAdView = (AdView)this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("TEST_DEVICE_ID")
.build();
mAdView.loadAd(adRequest);
Button b1 = (Button) findViewById(R.id.button1);
Button b2 = (Button) findViewById(R.id.button2);
Button b3 = (Button) findViewById(R.id.button3);
Button b4 = (Button) findViewById(R.id.button4);
Button b5 = (Button) findViewById(R.id.button5);
Button b6 = (Button) findViewById(R.id.button6);
b1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent1 = new Intent(Maingong.this, Sasalakon1.class);
startActivity(intent1);
}
});
b2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent2 = new Intent(Maingong.this, Nananangon2.class);
startActivity(intent2);
}
});
b3.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent3 = new Intent(Maingong.this, Hahambaton3.class);
startActivity(intent3);
}
});
b4.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent4 = new Intent(Maingong.this, Hohotukon4.class);
startActivity(intent4);
}
});
b5.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent5 = new Intent(Maingong.this, Kukulimpoon5.class);
startActivity(intent5);
}
});
b6.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent6 = new Intent(Maingong.this, Tatavag6.class);
startActivity(intent6);
}
});
}
@Override
protected void onPause(){
mAdView.pause();
super.onPause();
}
@Override
protected void onResume(){
super.onResume();
mAdView.resume();
}
@Override
protected void onDestroy(){
mAdView.destroy();
super.onDestroy();
}
}
Thank you in advance.