package com.samples.telephony.smsfoldersinfo;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class SmsFoldersListActivity extends ListActivity {
	
	String[] folders = {
			"inbox", "sent", "draft", "outbox", "failed", 
			"queued", "undelivered", "conversations"};
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	
		setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, folders));
	}
	
	public void onListItemClick(ListView parent, View v, int pos, long id)
	{
		Intent intent = new Intent(getApplicationContext(), 
				SmsFolderInfoActivity.class);
		intent.putExtra("uri", "content://sms/" + folders[pos]);
		this.startActivity(intent);
	}
}

