I have implemented an application to get the data from local mobile SQLite db and try for send to Custome Simple Cursor adapter class.I am recieving the data from BroadCast Reciever It is used for get the latest record from DB.If use SimpleCursorAdapter then i can get the data from Sqlite DB and updating to UI.But I can't pass the DB content to CustomeSimpleCursorAdapter.So how can i pass db content to CustomeSimpleCursorAdapter?
I have implemented code as follows:
private BroadcastReceiver myReceiver = new BroadcastReceiver()
{
@Override
public void onReceive(Context context, Intent intent) {
msh = new MySqliteHelper(GetMsgsScreen.this);
msh.openToWrite();
lst = ((ListView)findViewById(R.id.listView1));
cursor = msh.queueAll();
getFromDB = new String[]{MySqliteHelper.USER_NAME,MySqliteHelper.USER_MESSAGE};
toView = new int[]{R.id.usrName,R.id.msgText};
cursor.moveToFirst();
lst.setAdapter(new SimpleCursorAdapter(GetMsgsScreen.this, R.layout.test, cursor, getFromDB, toView));
updateList();
}
};
Similarly,
If I use CustomeSimpleCursorAdapter instead of SimpleCursorAdapter then how can i display MySqliteHelper.USER_NAME and MySqliteHelper.USER_MESSAGE content to list? please any body help me.