Skip to content

Instantly share code, notes, and snippets.

@wmbest2
Created October 11, 2010 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmbest2/621410 to your computer and use it in GitHub Desktop.
Save wmbest2/621410 to your computer and use it in GitHub Desktop.
package com.wmbest.iphone4;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.widget.Button;
import android.view.View;
import com.admob.android.ads.AdView;
public class iPhone4Launcher extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AdView ad = (AdView) findViewById(R.id.ad);
ad.setVisibility(View.VISIBLE);
Button on = (Button) findViewById(R.id.on);
Button off = (Button) findViewById(R.id.off);
on.setOnClickListener(new View.OnClickListener() {
public void onClick(View aView) {
Intent intent = new Intent("com.wmbest.iphone4.toggle_on");
iPhone4Launcher.this.sendBroadcast(intent);
}
});
off.setOnClickListener(new View.OnClickListener() {
public void onClick(View aView) {
Intent intent = new Intent("com.wmbest.iphone4.toggle_off");
iPhone4Launcher.this.sendBroadcast(intent);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment