@Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.del_tv: SureDelCollectSmsItemDailog dialog = new SureDelCollectSmsItemDailog( CollectListDetailActivity.this, R.style.Theme_CustomDialog); dialog.setItem(mSmsItem); dialog.showDialog(); break; case R.id.forward_tv: Intent intent = new Intent(CollectListDetailActivity.this, KindroidMessengerWriteMessageActivity.class); intent.putExtra( KindroidMessengerWriteMessageActivity.FORWARD_MESSAGE_KEY, mSmsItem.getmBody() + ""); startActivity(intent); break; default: break; } }
@Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { CollectCategory category = categoryList.get(arg2); CategorySmsListItem itemInfo = new CategorySmsListItem(); final SmsMmsMessage msgInfo = list.get(position); final String messageBody = msgInfo.getMessageBody(); final long timestamp = msgInfo.getTimestamp(); final String addressStr = msgInfo.getFromAddress(); final String dateStr = DateTimeUtil.long2String(timestamp, "MM/dd"); itemInfo.setInsertTime(dateStr); itemInfo.setmAddress(addressStr); itemInfo.setmBody(messageBody); itemInfo.setmCategoryId(category.getmId()); dismiss(); boolean ret = CollectionDataBase.get(ctx).insertCategorySmsItem(itemInfo); if (!ret) { Toast.makeText(ctx, R.string.collect_fail, Toast.LENGTH_SHORT).show(); } else { Toast.makeText(ctx, R.string.collect_success, Toast.LENGTH_SHORT).show(); } }
private void initContentViews() { View contentView = null; try { contentView = KindroidMessengerApplication.mThemeRegistry.inflate(LAYOUT_FILE); } catch (Exception e) { contentView = null; } if (contentView == null) { setContentView(R.layout.collect_detail_layout); } else { setContentView(contentView); } mSmsItem = (CategorySmsListItem) getIntent().getSerializableExtra(CollectListActivity.COLLET_LIST_ITEM); findView(); bindListenerToView(); mSmsContentTv.setText(mSmsItem.getmBody() + ""); }