package com.samples.telephony.smsfoldersinfo;

import android.app.ListActivity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;

public class SmsFolderInfoActivity extends ListActivity {
		
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		Bundle extras = this.getIntent().getExtras();
		Uri uri = Uri.parse(extras.getString("uri"));
		this.setTitle(uri.toString());
			
		Cursor cursor = getContentResolver().query(uri, null, null, null, null);
		startManagingCursor(cursor);
			
		String[] columns = new String[] { "address", "body" };
		int[] rows = new int[] { R.id.address, R.id.body };
			
		ListAdapter adapter = new SimpleCursorAdapter(
			this, R.layout.row, cursor, columns, rows);
		setListAdapter(adapter);
	}
}