列表视图无法滚动?

时间:2014-01-12 10:12:25

标签: android list sqlite

我正在编写从SQLite获取数据并附加到数组列表适配器的代码。进一步设置为listview。我正在使用该线程进行连续运行。

  final Handler checkhandlerparticular = new Handler(); 
        Runnable checkrunableparticular = new Runnable() 
        { 

            @Override 
            public void run() { 
                try{
                    //do your code here


                    int temp=mydb.getparticularmsgcheck(ToImei_no,from_imei);
                    System.out.println("The max value"+temp);
                    System.out.println("The max value"+Lastsrno);
                    //check the last converstion no and start to get new view
                    if(temp >= Lastsrno)
                    {



                                     arymsg=mydb.getAllmsg(ToImei_no);

                                    MeassageItemListAdapter=new MeassageListAdapter(getBaseContext(), arymsg);

                                    MeassageItemListAdapter.notifyDataSetChanged();
                                    lst.setAdapter(MeassageItemListAdapter);
                                    Lastsrno=temp;

                    }



                }
                catch (Exception e) {
                    // TODO: handle exception
                }
                finally{
                    //also call the same runnable 
                    checkhandlerparticular.postDelayed(this, 1000); 

                }
            } 
        }; 

        checkhandlerparticular.post(checkrunableparticular);    


    }

已使用的列表视图

<ListView
    android:id="@+id/listmsghstry"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" 
    android:stackFromBottom="true"
    android:transcriptMode="alwaysScroll"  >
</ListView>

0 个答案:

没有答案