I have created a custom banner that is a simple rectangle picture that sits on the bottom of the first activity screen after the app is opened. It is being displayed as an ImageView with clickable="true". I have a setOnClickListener ready to go. Just need help with the code that actually takes the user to my website when they click on my custom banner. Also, need to know what permission to ask for to cover this. I would assume it is android.permission.INTERNET. Thanks for your help in advance.
Ok, here is the code that ended up working. Thanks guys.
Inside the xml layout file for this activity:
<ImageView
android:src="@drawable/saas_banner"
android:clickable="true"
android:id="@+id/SaasBannerIMG"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
Inside the onCreate method for the activity:
// add a click listener to the SaaS Ad Banner
ImageView img = (ImageView) findViewById(R.id.SaasBannerIMG);
img.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.websitetogoto.com"));
startActivity(intent);
}
});