Java code:
public class SendSMS extends Activity{
private IShoppingListDao shoppingMgr;
private TextView mContact;
private TextView mMgr;
private Long mRowId;
private static final String TAG = "SendSMS";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.send_list_by_sms);
shoppingMgr = new ShoppingListDao(this);
shoppingMgr.open();
mContact = (TextView) findViewById(R.id.display_sendSms_name_contact);
mRowId = null;
Bundle extras = getIntent().getExtras();
mRowId = (savedInstanceState == null) ? null : (Long) savedInstanceState
.getSerializable(ContactsContract.Contacts.DISPLAY_NAME);
Log.d(TAG, "Row-id: "+mRowId);
if (extras != null) {
mRowId = extras.getLong(ContactsContract.Contacts.DISPLAY_NAME);
}
mMsg = (TextView) findViewById(R.id.input_sms_msg);
mMsg.setText(generateMsg());
populateFields();
}
private void populateFields() {
Log.d(TAG,"Entering populateFields");
Log.d(TAG,"Row-id: "+mRowId);
if (mRowId != null) {
ContentResolver contentr = getContentResolver();
String where = ContactsContract.Contacts._ID + " = " + mRowId;
Log.d(TAG,"String where: "+where);
Cursor listItem = contentr.query(
ContactsContract.Contacts.CONTENT_URI,
null,
where,
null, null);
startManagingCursor(listItem);
mContact.setText(listItem.getString(
listItem.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
}
}
Please solve me how I solve the above problem
Thanks in advance