Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.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
Android 如何修复不推荐的:startManagingCursor()_Android_Android Loadermanager_Android Loader - Fatal编程技术网

Android 如何修复不推荐的:startManagingCursor()

Android 如何修复不推荐的:startManagingCursor(),android,android-loadermanager,android-loader,Android,Android Loadermanager,Android Loader,我有一个关于绝望的密码 startManagingCursor(timelineCursor) 那个代码不再有效,但我必须如何使用loadmanager更改我的代码,我读了一些博客,但我仍然感到困惑。你能给我举个例子吗 这是我的全部代码 setContentView(R.layout.timeline); try { homeTimeline = (ListView)findViewById(R.id.homeList); //instan

我有一个关于绝望的密码

startManagingCursor(timelineCursor)
那个代码不再有效,但我必须如何使用loadmanager更改我的代码,我读了一些博客,但我仍然感到困惑。你能给我举个例子吗

这是我的全部代码

setContentView(R.layout.timeline);
        try {  

        homeTimeline = (ListView)findViewById(R.id.homeList);
        //instantiate database helper 
        timelineHelper = new NiceDataHelper(this);   
        //get the database 
        timelineDB = timelineHelper.getReadableDatabase();
         //query the database, most recent tweets first 
        timelineCursor = timelineDB.query("home", null, null, null, null, null, "update_time DESC");
        startManagingCursor(timelineCursor);
        //instantiate adapter 
        timelineAdapter = new UpdateAdapter(this, timelineCursor);
        //this will make the app populate the new update data in the timeline view 
        homeTimeline.setAdapter(timelineAdapter);
        //instantiate receiver class for finding out when new updates are available 
        niceStatusReceiver = new TwitterUpdateReceiver(); 
        //register for updates 
        registerReceiver(niceStatusReceiver, new IntentFilter("TWITTER_UPDATES"));
        Toast.makeText(getApplicationContext(), "teest", Toast.LENGTH_SHORT).show();
        //start the Service for updates now 
        this.getApplicationContext().startService(new Intent(this.getApplicationContext(), TimeLineService.class));

        } 
    catch(Exception te) { Log.e(LOG_TAG, "Failed to fetch timeline: " + te.getMessage()); }

装载机机架一旦发生故障就不难理解。您将需要使用管理器以及一组您自己的自定义回调。这篇文章应该会有所帮助