<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codigo Android &#187; codigo</title>
	<atom:link href="http://www.codigoandroid.com/category/codigo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codigoandroid.com</link>
	<description>Comunidad de programadores y desarrolladores para Android</description>
	<lastBuildDate>Sun, 08 Nov 2009 19:10:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Abrir URL web al hacer click en un botón</title>
		<link>http://www.codigoandroid.com/abrir-url-web-al-hacer-click-en-un-boton/</link>
		<comments>http://www.codigoandroid.com/abrir-url-web-al-hacer-click-en-un-boton/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 10:27:43 +0000</pubDate>
		<dc:creator>Mikel</dc:creator>
				<category><![CDATA[aplicacion]]></category>
		<category><![CDATA[codigo]]></category>
		<category><![CDATA[primeros pasos]]></category>
		<category><![CDATA[tutoriales]]></category>
		<category><![CDATA[abrir]]></category>
		<category><![CDATA[boton]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.codigoandroid.com/?p=40</guid>
		<description><![CDATA[Abrir dirección URL en Android]]></description>
			<content:encoded><![CDATA[<p>Vamos a aprender a abrir una URL a través de un botón.</p>
<p>Para ello vamos a crear un nuevo proyecto llamado lanzar web y vamos a ir a main.xml donde diseñaremos el botón.</p>
<p>Antes del  vamos a escribir:</p>
<pre class="codigo">&lt;Button android:id="@+id/abrir"
 android:text="@string/texto_abrir"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content" /&gt;</pre>
<p>Como ves, al boton le hemos asignado la id abrir y el string texto_abrir.</p>
<p>Vamos a strings.xml y vamos a añadir la variable texto_abrir</p>
<pre class="codigo">&lt;string name="texto_abrir"&gt;Abrir URL&lt;/string&gt;</pre>
<p>Ya hemos diseñado el botón, pero ahora hay que programarlo.<br />
Vamos fichero java y debajo del SetContentView añadimos lo siguiente:</p>
<pre class="codigo">Button abrir = (Button) findViewById(R.id.abrir);
        abrir.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.goear.com")));
            }
        });</pre>
<p>y lanzamos nuestra aplicación.</p>
<p>Un saludo</p>
<p><a title="ir al foro" href="../foro/showthread.php?p=4#post4">ir al Tema del FORO “Crear botón para abrir URL web”</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codigoandroid.com/abrir-url-web-al-hacer-click-en-un-boton/feed/</wfw:commentRss>
		<slash:comments>162</slash:comments>
		</item>
	</channel>
</rss>
