@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); state = savedInstanceState; this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.composer_list); /* SharedPreferences myPrefs = this.getSharedPreferences("username", MODE_WORLD_READABLE); autoPlay = myPrefs.getBoolean("autoPlay", true); */ list = (ListView) findViewById(R.id.list); list.setClickable(true); list.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { SMILMessageProxy sm = inbox.get(arg2); System.err.println(sm.getFilename()); Intent i = new Intent(OutboxList.this, ViewMessageActivity.class); i.putExtra("title", sm.getFilename()); i.putExtra("message", sm.getMessage()); i.putExtra("sender", sm.getSender()); i.putExtra("index", arg2); System.out.println(sm.getModified()); i.putExtra("date", new SimpleDateFormat("MM/dd/yyyy").format(sm.getModified())); i.putExtra("key", sm.getKey()); OutboxList.this.startActivity(i); } }); /* alertAutoPlay = new AlertDialog.Builder(this).create(); alertAutoPlay.setTitle("Did you know?"); alertAutoPlay.setMessage("If you turn your phone into landscape mode the message will automatically play. Turn your phone back up to return to the message screen."); alertAutoPlay.setButton("Let me try!", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertAutoPlay.setButton2("Not for me! (disable feature)", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { SharedPreferences.Editor myPrefEdit = ComposerList.this.getSharedPreferences("username", MODE_WORLD_READABLE).edit(); myPrefEdit.putBoolean("autoPlay", false); myPrefEdit.commit(); ComposerList.autoPlay = false; playMessage(true); return; } }); */ alertAddItem = new AlertDialog.Builder(this); alertAddItem.setTitle("Add Item"); final CharSequence[] addItemOptions = {"Text", "Image"}; alertAddItem.setItems( addItemOptions, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialogInterface, int item) { System.out.println("Item num: " + item); // Intent i = new Intent(InboxList.this, ViewMessageActivity.class); // i.putExtra("newItem", addItemOptions[item]); // InboxList.this.startActivity(i); // this.startActivityForResult(i, REQ_CODE_PLAYER); } }); _actionBar = (ActionBar) findViewById(R.id.actionBar); _actionBar.setTitle("Outbox"); _actionBar.setHomeListener( new OnClickListener() { public void onClick(View v) { OutboxList.this.finish(); } }); _actionBar.addActionIcon( R.drawable.ic_list, new OnClickListener() { public void onClick(View v) { alertAddItem.show(); } }); _actionBar.addActionIcon( R.drawable.ic_movie, new OnClickListener() { public void onClick(View v) { playMessage(true); return; } }); _actionBar.addActionIcon( R.drawable.ic_send, new OnClickListener() { public void onClick(View v) { Intent i = new Intent(OutboxList.this, ComposerSend.class); OutboxList.this.startActivity(i); return; } }); /* items = new ScrollItemManager(findViewById(R.id.scrollHolder)); items.addItem(getApplicationContext()); items.setTitle("Text Item 1"); items.setListener(this, 1); */ }