Open FileDialog on click event
<p>I am a beginner in Android I am trying to develop Set Wallpaper App.After clicking on image second activity will open.Here is my code:</p>

<p>manifest.xml</p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myfirstapplication"
    android:versionCode="1"
    android:versionName="1.0" &gt;
     &lt;uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="15" /&gt;

   &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" &gt;
        &lt;activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" &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=".secondActivity"
                  android:label="@string/app_name"&gt;
        &lt;/activity&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>activity_main.xml</p>

<pre><code> &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="wrap_content"
     android:layout_height="fill_parent"
     android:orientation="vertical"
     android:paddingLeft="8dp"
     android:paddingRight="8dp" &gt;

     &lt;ImageView
         android:id="@+id/imageView1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@android:drawable/btn_star_big_on"
         android:clickable="true"  
         android:onClick="imageClick"  /&gt;

     &lt;TextView
         android:id="@android:id/empty"
         android:layout_width="150dp"
         android:layout_height="wrap_content"
         android:text="Wallpaper" /&gt;
 &lt;/LinearLayout&gt;
</code></pre>

<p>main.xml</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="wrap_content"
     android:layout_height="fill_parent"
     android:orientation="vertical"
     android:paddingLeft="8dp"
     android:paddingRight="8dp" &gt;

    &lt;Button
        android:id="@+id/set"
        android:layout_width="298dp"
        android:layout_height="70dp"
        android:text="Set Wallpaper" /&gt;


    &lt;Button
        android:id="@+id/hoti"
        android:layout_width="fill_parent"
        android:layout_height="193dp"
        android:text="HOTI" /&gt;

    &lt;Button
        android:id="@+id/smb"
        android:layout_width="298dp"
        android:layout_height="70dp"
        android:text="See More" /&gt;
    &lt;Button
        android:id="@+id/quit"
        android:layout_width="298dp"
        android:layout_height="70dp"
        android:text="Quit" /&gt;
 &lt;/LinearLayout&gt;
</code></pre>

<p>MainActivity.java</p>

<pre><code>package com.example.myfirstapplication;

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

public class MainActivity extends Activity {

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


public void imageClick(View v){

    //Create an intent to start the new activity.
       // Our intention is to start secondActivity
    Intent intent = new Intent();
    intent.setClass(this,secondActivity.class);
    startActivity(intent);
   }
}
</code></pre>

<p>secondActivity.java</p>

<pre><code>package com.example.myfirstapplication;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class secondActivity extends Activity {
    Bitmap bitmap;
   /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

     // Set the layout for this activity
        setContentView(R.layout.main);


        Button btn1 = (Button) findViewById(R.id.quit);
        btn1.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                finish();
                System.exit(0);
            }
        });
        }

}
</code></pre>

<p>After clicking on set wallpaper button the file chooser should open from which I can choose image and also I can see preview of that image and can set it as a wallpaper.Please help me out.
I also want to open a popup window after clicking on "see more" button.</p>
