Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>final class ThSynchronizer implements Runnable { Context context = null; public void setContext(Context ctxt) { context = ctxt; } @Override public void run() { NRSynchronizer synchronizer = new NRSynchronizer(); synchronizer.processIBMessages(getApplicationContext()); } } </code></pre> <p>on action try below code</p> <pre><code>ThSynchronizer synchThread = new ThSynchronizer(); synchThread.setContext(getApplicationContext()); Thread threadSynh = new Thread(synchThread); threadSynh.start(); </code></pre> <p>den call the below function</p> <pre><code>public void processIBMessages(Context context) { setContext(context); getMessagesFromServer(context); NRSynchAdapter synchAdapter = new NRSynchAdapter (context); synchAdapter.open(); Cursor cursor = synchAdapter.fetchAllIBMessage(); int rowCount = cursor.getCount(); if (rowCount&gt;0){ cursor.moveToFirst(); } for (int i = 0; i &lt; rowCount; i++) { String content = null; // based on message type may need to call getMessageContent(also) if (cursor.getColumnIndex("content") != -1) { content = cursor.getString(cursor .getColumnIndex("content")); } String headers = null; if (cursor.getColumnIndex("headers") != -1) { headers = cursor.getString(cursor .getColumnIndex("headers")); } if((headers != null)&amp;&amp;(!headers.trim().isEmpty()&amp;&amp;(content!=null)&amp;&amp;(!content.trim().isEmpty()))){ handleIBMessage(context, headers,content); long rowId = cursor.getLong(cursor .getColumnIndex("_id")); synchAdapter.deleteInboxMsg(rowId); } cursor.moveToNext(); } synchAdapter.close(); return; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload