<?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>Worldling.de</title>
	<atom:link href="http://www.worldling.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.worldling.de</link>
	<description>Java EE, Android und Core Java</description>
	<lastBuildDate>Wed, 28 Mar 2012 09:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Einfaches XML Parsen in Android mit SimpleXML (XML Parsing)</title>
		<link>http://www.worldling.de/einfaches-xml-parsen-in-android-mit-simplexml-xml-parsing/</link>
		<comments>http://www.worldling.de/einfaches-xml-parsen-in-android-mit-simplexml-xml-parsing/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 06:56:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[Parsen]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[SimpleXML]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[xml parsing]]></category>
		<category><![CDATA[xml parsing android]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=618</guid>
		<description><![CDATA[Einfaches XML Parsen in Android mit SimpleXML Erstmal müssen wir den .jar runterladen: http://simple.sourceforge.net/download.php Dan geben wir ihn in den Buil Path ein: Im Manifest muss die Permission sein: &#60;uses-permission android:name="android.permission.INTERNET" /&#62; Die einfache XML die wir parsen: &#60;data&#62; &#60;name&#62;Example Name&#60;/name&#62; &#60;/data&#62; &#160; Hier unser Ergebniss: &#160; &#8230;und der Code: &#160; Data.java package de.worldling; import [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Einfaches XML Parsen in Android mit SimpleXML</strong></p>
<p>Erstmal müssen wir den .jar runterladen:<a href="http://simple.sourceforge.net/download.php"> http://simple.sourceforge.net/download.php</a></p>
<p>Dan geben wir ihn in den Buil Path ein:</p>
<p><img class="alignnone  wp-image-619" title="addbuldpath" src="http://www.worldling.de/wp-content/uploads/2012/02/addbuldpath.png" alt="" width="521" height="42" /></p>
<p>Im Manifest muss die Permission sein:</p>
<pre class="xml" name="code">
&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
</pre>
<p>Die einfache XML die wir parsen:</p>
<pre class="xml" name="code">
&lt;data&gt;
&lt;name&gt;Example Name&lt;/name&gt;
&lt;/data&gt;
</pre>
<p>&nbsp;<br />
Hier unser Ergebniss:<br />
<img class="alignnone size-full wp-image-624" title="zzzzzzzzzzz" src="http://www.worldling.de/wp-content/uploads/2012/02/zzzzzzzzzzz.png" alt="" width="542" height="230" /></p>
<p>&nbsp;<br />
&#8230;und der Code:<br />
&nbsp;<br />
<strong>Data.java</strong></p>
<pre class="java" name="code">
package de.worldling;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

@Root
public class Data {

	public Data(){
		super();
	}

	public Data(String name){
		this.name = name;
	}

	@Element
	private String name;

	public String getName() {
		return name;
	}
}
</pre>
<p>&nbsp;<br />
<strong>SimpleParsingTestActivity.java</strong></p>
<pre class="java" name="code">
package de.worldling;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;

public class SimpleParsingTestActivity extends Activity {

	private static final String url = "http://www.worldling.de/data.xml";
	TextView name;
	private DefaultHttpClient client = new DefaultHttpClient();

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		name = (TextView) findViewById(R.id.tvForParsing);

		parseXml();
	}

	private void parseXml() {
		try {
			String xmlData = retrieve(url);
			Serializer serializer = new Persister();

			Reader reader = new StringReader(xmlData);
			Data user = serializer.read(Data.class, reader);

			String tempName = user.getName();
			name.setText(tempName);
		} catch (Exception e) {
			Toast.makeText(this, "Error Occured", Toast.LENGTH_LONG).show();
		}

	}

	public String retrieve(String url) {

		HttpGet getRequest = new HttpGet(url);
		try {
			HttpResponse getResponse = client.execute(getRequest);
			final int statusCode = getResponse.getStatusLine().getStatusCode();

			if (statusCode != HttpStatus.SC_OK) {
				return null;
			}

			HttpEntity getResponseEntity = getResponse.getEntity();
			if (getResponseEntity != null) {
				return EntityUtils.toString(getResponseEntity);
			}
		} catch (IOException e) {
			getRequest.abort();
			Log.w(getClass().getSimpleName(), "Error for URL " + url, e);
		}
		return null;

	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/einfaches-xml-parsen-in-android-mit-simplexml-xml-parsing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SharedPreferences in Android</title>
		<link>http://www.worldling.de/sharedpreferences-in-android/</link>
		<comments>http://www.worldling.de/sharedpreferences-in-android/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 08:27:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[SharedPreferences]]></category>
		<category><![CDATA[SharedPreferences in Android]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=612</guid>
		<description><![CDATA[SharedPreferences in Android Heute ohne xml, nur Java Code für eine einfache SharedPreferences App &#160; package de.worldling; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; public class PreferencesTestActivity extends Activity implements OnClickListener{ EditText editText; SharedPreferences sharedPreferences; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setupStuff(); [...]]]></description>
			<content:encoded><![CDATA[<p><strong>SharedPreferences in Android</strong></p>
<p>Heute ohne xml, nur Java Code für eine einfache SharedPreferences App</p>
<p>&nbsp;</p>
<pre name="code" class="java">
package de.worldling;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class PreferencesTestActivity extends Activity implements OnClickListener{

	EditText editText;
	SharedPreferences sharedPreferences;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        setupStuff();
        sharedPreferences = getSharedPreferences("SharedString1", 0);
    }

	private void setupStuff() {
		Button next = (Button) findViewById(R.id.bNext);
		Button save = (Button) findViewById(R.id.bSave);
		editText = (EditText) findViewById(R.id.et1);

		next.setOnClickListener(this);
		save.setOnClickListener(this);
	}

	public void onClick(View v) {
		switch (v.getId()){
		case R.id.bSave:
			String string = editText.getText().toString();//set up string to save
			Editor editor = sharedPreferences.edit(); //edit the SharedPreferences 'sharedPreferences'
			editor.putString("string1", string); //put the string and lable it as "string1"
			editor.commit(); //commit it
			break;
		case R.id.bNext:
			Intent intent = new Intent(PreferencesTestActivity.this, NewClass.class);
			startActivity(intent);
			break;
		}
	}
}
</pre>
<pre name="code" class="java">
package de.worldling;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

public class NewClass extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.two);
		TextView tv2 = (TextView) findViewById(R.id.tv2);

		SharedPreferences someData = getSharedPreferences("SharedString1", 0);
		String dataReturned = someData.getString("string1", "default");
		tv2.setText(dataReturned);
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/sharedpreferences-in-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Auf Preferences in Android Zugreifen</title>
		<link>http://www.worldling.de/auf-preferences-in-android-zugreifen/</link>
		<comments>http://www.worldling.de/auf-preferences-in-android-zugreifen/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 09:05:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Preferences]]></category>
		<category><![CDATA[Zugreifen]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=598</guid>
		<description><![CDATA[Auf Preferences in Android Zugreifen &#160; private TextView textView; textView = (TextView) findViewById(R.id.tv1); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); String string = sharedPreferences.getString("thename", ""); textView.setText(string); &#160;]]></description>
			<content:encoded><![CDATA[<p><strong>Auf Preferences in Android Zugreifen</strong><br />
&nbsp;</p>
<pre name="code" class="java">
private TextView textView;
textView = (TextView) findViewById(R.id.tv1);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
String string = sharedPreferences.getString("thename", "");
textView.setText(string);
</pre>
<p><img class="alignnone size-full wp-image-606" title="matt2" src="http://www.worldling.de/wp-content/uploads/2012/02/matt2.png" alt="" width="413" height="281" /></p>
<p><img class="alignnone size-full wp-image-607" title="111111111111" src="http://www.worldling.de/wp-content/uploads/2012/02/111111111111.png" alt="" width="505" height="119" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/auf-preferences-in-android-zugreifen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android Preferences setzen mit Menu und PreferenceActivity</title>
		<link>http://www.worldling.de/android-preferences-setzen-mit-menu-und-preferenceactivity/</link>
		<comments>http://www.worldling.de/android-preferences-setzen-mit-menu-und-preferenceactivity/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 07:58:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[addPreferencesFromResource]]></category>
		<category><![CDATA[Inflate]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[MenuInflater]]></category>
		<category><![CDATA[PreferenceActivity]]></category>
		<category><![CDATA[Preferences]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=586</guid>
		<description><![CDATA[Android Preferences setzen mit Menu und PreferenceActivity &#160; Es müssen 3 .xml Dateien erschaffen werden: menu1.xml, array.xml und prefs1.xml menu1.xml &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;menu xmlns:android="http://schemas.android.com/apk/res/android" &#62; &#60;item android:id="@+id/preferences" android:title="Preferences"/&#62; &#60;item android:id="@+id/exit" android:title="Exit App"/&#62; &#60;/menu&#62; &#160; &#160; array.xml &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;resources&#62; &#60;string-array name="list"&#62; &#60;item&#62; Option 1 &#60;/item&#62; &#60;item&#62; Option 2 &#60;/item&#62; &#60;/string-array&#62; &#60;string-array name="values"&#62; &#60;item&#62;1&#60;/item&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Android Preferences setzen mit Menu und PreferenceActivity</strong></p>
<p>&nbsp;</p>
<p>Es müssen 3 .xml Dateien erschaffen werden: menu1.xml, array.xml und prefs1.xml</p>
<p><img class="alignnone size-full wp-image-590" title="preff3" src="http://www.worldling.de/wp-content/uploads/2012/02/preff3.png" alt="" width="223" height="285" /></p>
<p><strong>menu1.xml</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;

&lt;item
android:id="@+id/preferences"
android:title="Preferences"/&gt;
&lt;item
android:id="@+id/exit"
android:title="Exit App"/&gt;

&lt;/menu&gt;
</pre>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-591" title="preff4" src="http://www.worldling.de/wp-content/uploads/2012/02/preff4.png" alt="" width="516" height="140" /></p>
<p>&nbsp;</p>
<p><strong>array.xml</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;

&lt;string-array name="list"&gt;
&lt;item&gt; Option 1 &lt;/item&gt;
&lt;item&gt; Option 2 &lt;/item&gt;
&lt;/string-array&gt;

&lt;string-array name="values"&gt;
&lt;item&gt;1&lt;/item&gt;
&lt;item&gt;2&lt;/item&gt;
&lt;/string-array&gt;

&lt;/resources&gt;
</pre>
<p>&nbsp;</p>
<p><strong>prefs1.xml</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt;

&lt;EditTextPreference
android:key="The name"
android:summary="Your name:"
android:title="Name" /&gt;

&lt;ListPreference
android:entries="@array/list"
android:entryValues="@array/values"
android:key="List Pref1"
android:summary="The List Preference"
android:title="List" /&gt;

&lt;/PreferenceScreen&gt;
</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-587" title="preff1" src="http://www.worldling.de/wp-content/uploads/2012/02/preff1.png" alt="" width="505" height="584" /></p>
<p><img class="alignnone size-full wp-image-588" title="preff2" src="http://www.worldling.de/wp-content/uploads/2012/02/preff2.png" alt="" width="501" height="616" /></p>
<p>Der Java Code:</p>
<p>&nbsp;<br />
<strong>PrefTestActivity.java</strong></p>
<pre class="java" name="code">
package de.worldling;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuInflater;
import android.view.MenuItem;

public class PrefTestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		// TODO Auto-generated method stub
		super.onCreateOptionsMenu(menu);
		MenuInflater menuInflater = getMenuInflater();
		menuInflater.inflate(R.menu.menu1, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch(item.getItemId()){
		case R.id.preferences:
			Intent intent = new Intent(PrefTestActivity.this, Prefs1.class);
			startActivity(intent);
			break;
		case R.id.exit:
			finish();
			break;
		}
		return false;
	}
}
</pre>
<p>&nbsp;<br />
<strong>Prefs1.java</strong></p>
<pre class="java" name="code">
package de.worldling;

import android.os.Bundle;
import android.preference.PreferenceActivity;

public class Prefs1 extends PreferenceActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.prefs1);

	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/android-preferences-setzen-mit-menu-und-preferenceactivity/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Android &#8211; Parameters passing zu einer anderen Activity</title>
		<link>http://www.worldling.de/android-parameters-passing-zu-einer-anderen-activity/</link>
		<comments>http://www.worldling.de/android-parameters-passing-zu-einer-anderen-activity/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 10:08:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Activity]]></category>
		<category><![CDATA[Parameters]]></category>
		<category><![CDATA[Parameters passing]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=573</guid>
		<description><![CDATA[Android &#8211; Parameters passing zu einer anderen Activity Eine App in der man mit Button Click einen Parameter zu einer anderen Activity weiter recht. &#160; &#160; &#160; main.xml &#160; &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:padding="40dp" android:layout_height="fill_parent" android:orientation="vertical" &#62; &#60;EditText android:id="@+id/etPar" android:layout_width="fill_parent" android:layout_height="wrap_content" &#62; &#60;/EditText&#62; &#60;Button android:id="@+id/bPar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" Pass the parameter" /&#62; &#60;/LinearLayout&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Android &#8211; Parameters passing zu einer anderen Activity</strong></p>
<p>Eine App in der man mit Button Click einen Parameter zu einer anderen Activity weiter recht.</p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-575" title="par123" src="http://www.worldling.de/wp-content/uploads/2012/02/par123.png" alt="" width="495" height="342" /></p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-576" title="par1234" src="http://www.worldling.de/wp-content/uploads/2012/02/par1234.png" alt="" width="502" height="193" /></p>
<p>&nbsp;</p>
<p><strong>main.xml</strong></p>
<p>&nbsp;</p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:padding="40dp"
android:layout_height="fill_parent"
android:orientation="vertical" &gt;

&lt;EditText
android:id="@+id/etPar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" &gt;
&lt;/EditText&gt;

&lt;Button
android:id="@+id/bPar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=" Pass the parameter" /&gt;

&lt;/LinearLayout&gt;
</pre>
<p>&nbsp;</p>
<p><strong>new_lay.xml</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="40dp"&gt;

&lt;TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Your parameter: " /&gt;

&lt;TextView
android:id="@+id/tvPar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#00FFFF"
android:text="..." /&gt;

&lt;/LinearLayout&gt;
</pre>
<p>&nbsp;</p>
<p><strong>Manifest:</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.worldling"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;uses-sdk android:minSdkVersion="8" /&gt;

&lt;application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" &gt;
&lt;activity
android:name=".ParActivity"
android:label="@string/app_name" &gt;
&lt;intent-filter&gt;
&lt;action android:name="android.intent.action.MAIN" /&gt;

&lt;category android:name="android.intent.category.LAUNCHER" /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;activity
android:name=".NewClass"
android:label="@string/app_name" &gt;
&gt;
&lt;/activity&gt;
&lt;/application&gt;

&lt;/manifest&gt;
</pre>
<p>&nbsp;</p>
<p><strong>ParActivity.java</strong></p>
<pre  class="java" name="code">
package de.worldling;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class ParActivity extends Activity implements OnClickListener{

	EditText editText;
	Button button;
	String string;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        initStuff();
    }

	private void initStuff() {
		editText = (EditText) findViewById(R.id.etPar);
		button = (Button) findViewById(R.id.bPar);

		button.setOnClickListener(this);
	}

	public void onClick(View v) {
		string = editText.getText().toString();
		Bundle bundle = new Bundle();
		bundle.putString("key1", string);
		Intent intent = new Intent(ParActivity.this, NewClass.class);
		intent.putExtras(bundle);
		startActivity(intent);
	}
}
</pre>
<p>&nbsp;<br />
<strong>NewClass.java</strong></p>
<pre  class="java" name="code">
package de.worldling;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class NewClass extends Activity{

		TextView textView;
		String string;

		@Override
		protected void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.new_lay);

			textView = (TextView) findViewById(R.id.tvPar);

			Bundle bundle = getIntent().getExtras();
			string = bundle.getString("key1");
			textView.setText(string);
		}

}
</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/android-parameters-passing-zu-einer-anderen-activity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ToggleButton &#8211; Password hiding in Android</title>
		<link>http://www.worldling.de/togglebutton-password-hiding-in-android/</link>
		<comments>http://www.worldling.de/togglebutton-password-hiding-in-android/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 09:24:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Password hiding]]></category>
		<category><![CDATA[ToggleButton]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=562</guid>
		<description><![CDATA[ToggleButton &#8211; Password hiding in Android Eine App, die mit dem ToogleButton unser Password anzeigt oder es versteckt. main.xml &#160; &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="40dp" &#62; &#60;EditText android:id="@+id/etPass" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Type the password" android:password="true" /&#62; &#60;ToggleButton android:id="@+id/tbPassword" android:layout_width="fill_parent" android:layout_height="wrap_content" android:checked="true" android:paddingBottom="10dp" android:text="ToggleButton" android:textOff="Showing password" android:textOn="Hiding password" /&#62; &#60;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ToggleButton &#8211; Password hiding in Android</strong></p>
<p>Eine App, die mit dem ToogleButton unser Password anzeigt oder es versteckt.</p>
<p><img class="alignnone size-full wp-image-563" title="pass1" src="http://www.worldling.de/wp-content/uploads/2012/02/pass1.png" alt="" width="502" height="391" /></p>
<p><img class="alignnone size-full wp-image-564" title="pass2" src="http://www.worldling.de/wp-content/uploads/2012/02/pass2.png" alt="" width="501" height="356" /></p>
<p><strong>main.xml</strong></p>
<p>&nbsp;</p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="40dp" &gt;

&lt;EditText
android:id="@+id/etPass"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Type the password"
android:password="true" /&gt;

&lt;ToggleButton
android:id="@+id/tbPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:checked="true"
android:paddingBottom="10dp"
android:text="ToggleButton"
android:textOff="Showing password"
android:textOn="Hiding password" /&gt;

&lt;LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100" &gt;

&lt;TextView
android:id="@+id/tvPass"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="match_parent"
android:layout_weight="30"
android:text="..." /&gt;

&lt;Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="70"
android:text="Check" /&gt;
&lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;
</pre>
<p>&nbsp;<br />
<img class="alignnone size-full wp-image-569" title="pass3" src="http://www.worldling.de/wp-content/uploads/2012/02/pass3.png" alt="" width="423" height="328" /></p>
<p><strong>Unser Java Code</strong>:</p>
<pre class="java" name="code">
package de.worldling;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import android.widget.TextView;
import android.widget.ToggleButton;

public class PassProjectActivity extends Activity implements View.OnClickListener {

	EditText editText;
	Button button;
	ToggleButton toggleButton;
	TextView textView;
	String string;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        initStuff();
    }

	private void initStuff() {
		editText = (EditText) findViewById(R.id.etPass);
		button = (Button) findViewById(R.id.button1);
		toggleButton = (ToggleButton) findViewById(R.id.tbPassword);
		textView = (TextView) findViewById(R.id.tvPass);

        button.setOnClickListener(this);
        toggleButton.setOnClickListener(this);
	}

	public void onClick(View v) {

		switch (v.getId()){
		case R.id.tbPassword:
			if (toggleButton.isChecked()){
				editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
			} else{
				editText.setInputType(InputType.TYPE_CLASS_TEXT);
			}
			break;

		case R.id.button1:
			string = editText.getText().toString();
			if(string.equals("pass")){
				textView.setText(string);
				textView.setTextColor(Color.GREEN);
			}else{
				textView.setText("WRONG");
				textView.setTextColor(Color.RED);
			}
			break;

		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/togglebutton-password-hiding-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android GraphicsView &#8211; einen Gradient Background setzen und Circles Malen</title>
		<link>http://www.worldling.de/android-graphicsview-einen-gradient-background-setzen-und-circles-malen/</link>
		<comments>http://www.worldling.de/android-graphicsview-einen-gradient-background-setzen-und-circles-malen/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 12:45:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Circles]]></category>
		<category><![CDATA[Gradient Background]]></category>
		<category><![CDATA[GraphicsView]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=554</guid>
		<description><![CDATA[Android GraphicsView &#8211; einen Gradient Background setzen und Circles Malen &#160; Heute machen wir mall so etwas in Android: &#160; background.xml &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;shape xmlns:android="http://schemas.android.com/apk/res/android" &#62; &#60;gradient android:angle="270" android:endColor="#000000" android:startColor="#FFFFFF" /&#62; &#60;/shape&#62; Die Activity: package com.example; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path.Direction; import android.graphics.drawable.Drawable; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Android GraphicsView &#8211; einen Gradient Background setzen und Circles Malen</strong><br />
&nbsp;<br />
Heute machen wir mall so etwas in Android:</p>
<p><img class="alignnone size-full wp-image-555" title="circles" src="http://www.worldling.de/wp-content/uploads/2012/02/circles.png" alt="" width="509" height="827" /></p>
<p>&nbsp;</p>
<p><strong>background.xml</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;shape xmlns:android="http://schemas.android.com/apk/res/android" &gt;

&lt;gradient
android:angle="270"
android:endColor="#000000"
android:startColor="#FFFFFF" /&gt;

&lt;/shape&gt;
</pre>
<p>Die Activity:</p>
<pre class="java" name="code">
package com.example;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class Start1 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new GraphicsView(this));

	}

	static public class GraphicsView extends View {
		public GraphicsView(Context context) {
			super(context);
			setBackgroundResource(R.drawable.background);
		}

		@Override
		protected void onDraw(Canvas canvas) {
			Paint paint1 = new Paint();
			Paint paint2 = new Paint();
			paint1.setColor(Color.WHITE);
			paint2.setColor(Color.BLACK);	

			Path circle = new Path();
			Path circle2 = new Path();
			Path circle3 = new Path();

			circle.addCircle(300, 300, 200, Direction.CW);
			canvas.drawPath(circle, paint1);
			circle2.addCircle(300, 300, 50, Direction.CW);
			canvas.drawPath(circle2, paint2);
			circle3.addCircle(300, 300, 10, Direction.CW);
			canvas.drawPath(circle3, paint1);
		}

	}
}
</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/android-graphicsview-einen-gradient-background-setzen-und-circles-malen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ein Android Splash Screen Tutorial (mit mp3 Sound)</title>
		<link>http://www.worldling.de/ein-android-splash-screen-tutorial-mit-mp3-sound/</link>
		<comments>http://www.worldling.de/ein-android-splash-screen-tutorial-mit-mp3-sound/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 08:28:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[mp3 Sound]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[sound tutorial]]></category>
		<category><![CDATA[Splash]]></category>
		<category><![CDATA[SPlash Screen Tutorial]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=541</guid>
		<description><![CDATA[Ein Android Splash Screen Tutorial (mit mp3 Sound) Es ist immer gut, wenn eine Android App uns mit einen Splash Screen begrüßt. Hier ein Tutorial dafür: Der splash.xml: &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/back" &#62; &#60;/LinearLayout&#62; Der Manifest: &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.worldling" android:versionCode="1" android:versionName="1.0" &#62; &#60;uses-sdk android:minSdkVersion="8" /&#62; &#60;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Ein Android Splash Screen Tutorial (mit mp3 Sound)</strong></p>
<p>Es ist immer gut, wenn eine Android App uns mit einen Splash Screen <em></em>begrüßt. Hier ein Tutorial dafür:</p>
<p>Der <strong>splash.xml:</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/back"
&gt;
&lt;/LinearLayout&gt;
</pre>
<p><img class="alignnone  wp-image-547" style="margin: 10px;" title="splash" src="http://www.worldling.de/wp-content/uploads/2012/02/splash.png" alt="" width="233" height="213" /><br />
Der Manifest:</p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.worldling"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;uses-sdk android:minSdkVersion="8" /&gt;

&lt;application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" &gt;
&lt;activity
android:name=".Splash"
android:label="@string/app_name" &gt;
&lt;intent-filter&gt;
&lt;action android:name="android.intent.action.MAIN" /&gt;

&lt;category android:name="android.intent.category.LAUNCHER" /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;activity
android:name=".Sound1"
android:label="@string/app_name" &gt;
&lt;intent-filter&gt;
&lt;action android:name="de.worldling.SOUND1" /&gt;

&lt;category android:name="android.intent.category.DEFAULT" /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;/application&gt;

&lt;/manifest&gt;
</pre>
<p>Und die Java Classe,<strong> splash.java</strong>:</p>
<p>&nbsp;</p>
<pre class="java" name="code">
package de.worldling;

import java.io.IOException;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class Splash extends Activity {

	MediaPlayer mp;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);

		mp = MediaPlayer.create(Splash.this, R.raw.sound1);
		mp.start();

		Thread timer = new Thread() {
			public void run() {
				try {
					sleep(5000);// 5 seconds
				} catch (InterruptedException e) {
					e.printStackTrace();
				} finally {
					Intent openStartingPoint = new Intent("de.worldling.SOUND1");
					startActivity(openStartingPoint);
				}
			}
		};
		timer.start();
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		mp.release();
		finish();
	}

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/ein-android-splash-screen-tutorial-mit-mp3-sound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Tutorial &#8211;  Mp3 Sounds mit Button abspielen</title>
		<link>http://www.worldling.de/android-tutorial-mp3-sounds-mit-button-abspielen/</link>
		<comments>http://www.worldling.de/android-tutorial-mp3-sounds-mit-button-abspielen/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 11:47:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Android Tutorial]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[Mp3]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=531</guid>
		<description><![CDATA[Android Tutorial -  Mp3 Sounds mit Button abspielen Eine einfache App, mit der man einen Mp3 Sound abspielen kann. &#160; main.xml &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &#62; &#60;Button android:id="@+id/bAudio" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="50dp" android:text="Audio 1" android:textSize="20dp" /&#62; &#60;Button android:id="@+id/bAudio2" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_gravity="center" android:text="Audio 2" android:textSize="20dp" /&#62; &#60;/LinearLayout&#62; Unsere Activity package de.worldling; import [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Android Tutorial -  Mp3 Sounds mit Button abspielen</strong></p>
<p>Eine einfache App, mit der man einen Mp3 Sound abspielen kann.</p>
<p><img class="alignnone size-full wp-image-532" title="sound" src="http://www.worldling.de/wp-content/uploads/2012/02/sound.png" alt="" width="522" height="261" /></p>
<p>&nbsp;</p>
<p>main.xml</p>
<pre class="xml" name="code">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" &gt;

&lt;Button
android:id="@+id/bAudio"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="50dp"
android:text="Audio 1"
android:textSize="20dp" /&gt;

&lt;Button
android:id="@+id/bAudio2"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Audio 2"
android:textSize="20dp" /&gt;

&lt;/LinearLayout&gt;</pre>
<p>Unsere Activity</p>
<pre class="java" name="code">package de.worldling;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Sound1 extends Activity {

	public MediaPlayer mp;
	Button audio1, audio2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        audio1 = (Button) findViewById(R.id.bAudio);
        audio2 = (Button) findViewById(R.id.bAudio2);

        audio1.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				mp = MediaPlayer.create(getApplicationContext(), R.raw.sound1);
				mp.start();
			}
		});

        audio2.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				mp = MediaPlayer.create(getApplicationContext(), R.raw.sound2);
				mp.start();
			}
		});

    }
}</pre>
<p><img class="alignnone  wp-image-535" title="sound2" src="http://www.worldling.de/wp-content/uploads/2012/02/sound2.png" alt="" width="526" height="54" /></p>
<pre class="java"></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/android-tutorial-mp3-sounds-mit-button-abspielen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Einfache Android App &#8211; Dialog Theme und ein Exit Button</title>
		<link>http://www.worldling.de/einfache-android-app-dialog-theme-und-ein-exit-button/</link>
		<comments>http://www.worldling.de/einfache-android-app-dialog-theme-und-ein-exit-button/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 12:15:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android App]]></category>
		<category><![CDATA[Dialog Theme]]></category>
		<category><![CDATA[Exit Button]]></category>
		<category><![CDATA[TextVeiw]]></category>

		<guid isPermaLink="false">http://www.worldling.de/?p=507</guid>
		<description><![CDATA[Einfache Android App &#8211; Dialog Theme und ein Exit Button Wir schreiben ein Android App, die einen TextVeiw und zwei Buttons hat. So sieht sie aus: main.xml &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="horizontal"     android:padding="50dip" &#62;     &#60;LinearLayout         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_gravity="center"         android:orientation="vertical" &#62;         &#60;TextView             [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Einfache Android App &#8211; Dialog Theme und ein Exit Button</strong></p>
<p>Wir schreiben ein Android App, die einen TextVeiw und zwei Buttons hat.</p>
<p>So sieht sie aus:</p>
<p><img class="alignnone  wp-image-508" title="1" src="http://www.worldling.de/wp-content/uploads/2012/02/1.png" alt="" width="502" height="825" /><br />
<strong>main.xml</strong></p>
<pre class="xml" name="code">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:padding="50dip" &gt;

    &lt;LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="vertical" &gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginBottom="25dip"
            android:text="@string/title"
            android:textSize="30sp" /&gt;

        &lt;Button
            android:id="@+id/button1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/button1" /&gt;

        &lt;Button
            android:id="@+id/button2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/button2" /&gt;
    &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;</pre>
<p>&nbsp;<br />
Das sagt und wie der Layout aussehen soll. &#8216;fill_parent&#8217; oder &#8216;wrap_content&#8217;<br />
&nbsp;</p>
<pre class="xml" name="code">
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
</pre>
<p>Sind auch visuelle Aspekte.<br />
&nbsp;</p>
<pre class="xml" name="code">
        android:layout_gravity="center"
        android:orientation="vertical"
</pre>
<p>Welcher String sold dort sein?<br />
&nbsp;</p>
<pre class="xml" name="code">
	android:text="@string/title"
</pre>
<p>Wir geben den Button en ID<br />
&nbsp;</p>
<pre class="xml" name="code">
	android:id="@+id/button1"
</pre>
<p>Die erste<strong> Activity Class</strong>:</p>
<pre class="java" name="code">package de.worldling;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class Worldling1Activity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

		//click listeners
		View aboutButton = findViewById(R.id.button1);
		aboutButton.setOnClickListener(this);
		View exitButton = findViewById(R.id.button2);
		exitButton.setOnClickListener(this);
    }

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.button1:
			Intent i = new Intent(this, Test1.class);
			startActivity(i);
			break;
		case R.id.button2:
			finish();
			break;
		}

	}
}</pre>
<p>Ein Switch der die Buttons unterstützt<br />
&nbsp;</p>
<pre class="java" name="code">
    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.button1:
            Intent i = new Intent(this, Test1.class);
            startActivity(i);
            break;
        case R.id.button2:
            finish();
            break;
        }
    }
</pre>
<p>&nbsp;<br />
<strong>Test1.java</strong> &#8211; die Java Classe für den test1.xml</p>
<pre class="java" name="code">package de.worldling;

import android.app.Activity;
import android.os.Bundle;

public class Test1 extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.test1);
	}
}</pre>
<p><strong>test1.xml</strong> &#8211; der XML für unseren Dialog</p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="30dip" &gt;

&lt;TextView
android:id="@+id/about_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/test" /&gt;

&lt;/ScrollView&gt;
</pre>
<p><strong>strings.xml</strong> &#8211; wo alle String sind</p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;

&lt;string name="app_name"&gt;Worldling1&lt;/string&gt;
&lt;string name="title"&gt;Worldling1 App&lt;/string&gt;
&lt;string name="title2"&gt;Test1&lt;/string&gt;
&lt;string name="button1"&gt;Button&lt;/string&gt;
&lt;string name="button2"&gt;Exit&lt;/string&gt;
&lt;string name="test"&gt;Worldling test&lt;/string&gt;

&lt;/resources&gt;
</pre>
<p><img class="alignnone size-full wp-image-509" title="2" src="http://www.worldling.de/wp-content/uploads/2012/02/2.png" alt="" width="508" height="823" /><br />
<strong>Der Manifest</strong></p>
<pre class="xml" name="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.worldling"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;uses-sdk android:minSdkVersion="8" /&gt;

&lt;application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" &gt;
&lt;activity
android:name=".Worldling1Activity"
android:label="@string/app_name" &gt;
&lt;intent-filter&gt;
&lt;action android:name="android.intent.action.MAIN" /&gt;

&lt;category android:name="android.intent.category.LAUNCHER" /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;
&lt;activity
android:name=".Test1"
android:label="@string/title2"
android:theme="@android:style/Theme.Dialog" &gt;
&lt;/activity&gt;
&lt;/application&gt;

&lt;/manifest&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.worldling.de/einfache-android-app-dialog-theme-und-ein-exit-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

