Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
earchByAdd$List\u Async.doInBackground(SearchByAdd.java:1) 01-03 22:59:05.340:E/AndroidRuntime(15369):在android.os.AsyncTask$2.call(AsyncTask.java:287) 01-03 22:59:05.340:E/AndroidRuntime(15369):在java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-03 22:59:05.340:E/AndroidRuntime(15369):。。。还有5个 01-03 22:59:05.540:D/memalloc(15369):离子:映射的缓冲区基址:0x5570a000大小:1536000偏移量:0 fd:92 01-03 22:59:05.540:D/memalloc(15369):离子:映射缓冲区基址:0x53c33000大小:4096偏移量:0 fd:94_Java_Android_Multithreading_Sqlite_Android Asynctask - Fatal编程技术网

earchByAdd$List\u Async.doInBackground(SearchByAdd.java:1) 01-03 22:59:05.340:E/AndroidRuntime(15369):在android.os.AsyncTask$2.call(AsyncTask.java:287) 01-03 22:59:05.340:E/AndroidRuntime(15369):在java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-03 22:59:05.340:E/AndroidRuntime(15369):。。。还有5个 01-03 22:59:05.540:D/memalloc(15369):离子:映射的缓冲区基址:0x5570a000大小:1536000偏移量:0 fd:92 01-03 22:59:05.540:D/memalloc(15369):离子:映射缓冲区基址:0x53c33000大小:4096偏移量:0 fd:94

earchByAdd$List\u Async.doInBackground(SearchByAdd.java:1) 01-03 22:59:05.340:E/AndroidRuntime(15369):在android.os.AsyncTask$2.call(AsyncTask.java:287) 01-03 22:59:05.340:E/AndroidRuntime(15369):在java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-03 22:59:05.340:E/AndroidRuntime(15369):。。。还有5个 01-03 22:59:05.540:D/memalloc(15369):离子:映射的缓冲区基址:0x5570a000大小:1536000偏移量:0 fd:92 01-03 22:59:05.540:D/memalloc(15369):离子:映射缓冲区基址:0x53c33000大小:4096偏移量:0 fd:94,java,android,multithreading,sqlite,android-asynctask,Java,Android,Multithreading,Sqlite,Android Asynctask,如果读取堆栈跟踪,它会告诉您根本原因: Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 如果有任何数据是错误的,那么您检查的方式就是错误的。与其使用另一个字符串,不如检查ArrayList本身。在这里找零钱 private class LoadMoreAsync extends AsyncTask<Context,

如果读取堆栈跟踪,它会告诉您根本原因:

Caused by: java.lang.RuntimeException: Can't create handler inside thread 
that has not called Looper.prepare()

如果有任何数据是错误的,那么您检查的方式就是错误的。与其使用另一个字符串,不如检查ArrayList本身。在这里找零钱

private class LoadMoreAsync extends AsyncTask<Context, Void, Void>

@inj3ct0r编辑了我的答案。这只是一个小错误,现在你应该获得数据了。否则,您的查询是错误的。
    01-03 22:59:05.310: D/memalloc(15369): ion: Mapped buffer base:0x51d44000 size:4096 offset:0 fd:87
01-03 22:59:05.310: I/SearchQuery(15369): SELECT Address1,TotalMale,TotalFemale,TotalVoters, SrNo  FROM Addresses WHERE EAddress1 Like '%R%' LIMIT 20
01-03 22:59:05.330: W/dalvikvm(15369): threadid=16: thread exiting with uncaught exception (group=0x41a09600)
01-03 22:59:05.340: D/memalloc(15369): ion: Mapped buffer base:0x555da000 size:196608 offset:0 fd:84
01-03 22:59:05.340: D/memalloc(15369): ion: Mapped buffer base:0x51d4b000 size:4096 offset:0 fd:90
01-03 22:59:05.340: E/AndroidRuntime(15369): FATAL EXCEPTION: AsyncTask #3
01-03 22:59:05.340: E/AndroidRuntime(15369): java.lang.RuntimeException: An error occured while executing doInBackground()
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.lang.Thread.run(Thread.java:864)
01-03 22:59:05.340: E/AndroidRuntime(15369): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.os.Handler.<init>(Handler.java:121)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.widget.Toast$TN.<init>(Toast.java:322)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.widget.Toast.<init>(Toast.java:91)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.widget.Toast.makeText(Toast.java:238)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at com.phoenix.rajtantra.SearchByAdd$List_Async.doInBackground(SearchByAdd.java:284)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at com.phoenix.rajtantra.SearchByAdd$List_Async.doInBackground(SearchByAdd.java:1)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-03 22:59:05.340: E/AndroidRuntime(15369):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-03 22:59:05.340: E/AndroidRuntime(15369):    ... 5 more
01-03 22:59:05.540: D/memalloc(15369): ion: Mapped buffer base:0x5570a000 size:1536000 offset:0 fd:92
01-03 22:59:05.540: D/memalloc(15369): ion: Mapped buffer base:0x53c33000 size:4096 offset:0 fd:94
Caused by: java.lang.RuntimeException: Can't create handler inside thread 
that has not called Looper.prepare()
private class LoadMoreAsync extends AsyncTask<Context, Void, Void>
@Override
protected String doInBackground(Context... arg0) {
    // This just gets data from DB on background Thread
    mVoterArray = new ArrayList<AddressInfo>();
    mVoterArray = extDbUtil.getAddresslist(strAddress , limit += 20);

    return null;
}

@Override
protected void onPostExecute(Void v) {
    super.onPostExecute();

    // If the mVoterArray isnt null and if it isnt empty, then there is some data in there.
    if (mVoterArray != null && !mVoterArray.isEmpty()) {
        int position =  mListView.getLastVisiblePosition();
        mListAdapter = new ListAdapterNew2(mContext,
                android.R.layout.simple_list_item_1, mVoterArray);
        mListView.setAdapter(mListAdapter);
        mListView.setSelectionFromTop(position, 0);
        mListAdapter.notifyDataSetChanged();
    } else {
        ToastUtils.showToast(mContext, "No Record Found!!");
    }
}
do {
   AddressInfo mAddress = new AddressInfo();
   mAddress.setSrNO(mCursor.getString(mCursor
           .getColumnIndex("SrNo")));
   mAddress.setAddress(mCursor.getString(mCursor
            .getColumnIndex("Address1")));
   mAddress.setTotalMale(mCursor.getString(mCursor
            .getColumnIndex("TotalMale")));
   mAddress.setTotalFemal(mCursor.getString(mCursor
            .getColumnIndex("TotalFemale")));
   mAddress.setTotalVoter(mCursor.getString(mCursor
            .getColumnIndex("TotalVoters")));    

   // Add AddressInfo obejct ot ArrayList!
   mAddressArray.add(mAddress);

} while (mCursor.moveToNext());