How to launch activity using Intent.Action_view
<p>I declared <code>android:noHistory="true"</code> for my activty and trying to launch new activity using</p>

<pre><code>Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);
startActivityForResult(intent, PICK_CONTACT);
</code></pre>

<p>its closing my app, how to solve this (it is not force close)?</p>

<p>If i remove <code>nohistory="true"</code> then for evry time i add contact using above intent its placing my activity in stack and so even if i want to exit from my activity using back button its again showing my activity.</p>

<p>And also how to make the obtained list fastscrollable,multiselect,add alphabets etc.. is it possible to do that..??</p>

<p>for example </p>

<p>hope this code will be enough  .........................................
    public class ContactSelector extends Activity {
    public static final int PICK_CONTACT    = 1;
    private Button          btnContacts;
    private TextView        txtContacts;</p>

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

    btnContacts = (Button) findViewById(R.id.btn_contacts);
    txtContacts = (TextView) findViewById(R.id.txt_contacts);

    btnContacts.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);
            startActivityForResult(intent, PICK_CONTACT);
        }
    });
}

@Override
public void onActivityResult(int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    switch (reqCode) {
        case (PICK_CONTACT):
            if (resultCode == Activity.RESULT_OK) {
                Uri contactData = data.getData();
                Cursor c = managedQuery(contactData, null, null, null, null);
                if (c.moveToFirst()) {
                    String name = c.getString(c.getColumnIndexOrThrow(People.NAME));
                    txtContacts.setText(name);
                }
            }
            break;
    }
}
</code></pre>

<p>}</p>

<p>/<em>*</em>
* res/layout/main.xml
*</p>

<p>
</p>

<pre><code>&lt;Button
    android:id="@+id/btn_contacts" 
    android:layout_marginLeft="8px"
    android:layout_width="60px"
    android:layout_height="60px" /&gt;

&lt;TextView android:id="@+id/txt_contacts" 
    android:textSize="24sp"
    android:layout_margin="8px"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" /&gt;
</code></pre>

<p></p>

<p>/<em>*</em>
* AndroidManifest.xml
*</p>

<p>
</p>

<pre><code>&lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
&lt;uses-sdk android:minSdkVersion="3" /&gt;

&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
    &lt;activity android:name=".ContactSelector"
              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;/application&gt;
</code></pre>

<p></p>
