我最近从“Difficulty Reading with Atom Reader”的问题做过。现在,我正在计划一些关于我从Android Froyo到Jellybean创建的博客应用的最大兼容性。问题是我在使用StrictMode进行检查时收到错误通知。我通过Windows 7 OS运行Eclipse IDE。制作Atom/RSS阅读器速度与可靠性
//-----[ UI Thread Debug Setup ]-----
if(DEVELOPER_MODE)
{
/*
*
* Manage main thread control for Android 3.0 and later. Not work on Android 2.3.3 and below, otherwise, you will get an error
* for changing minimum SDK version at manifest. If you want to publish this project as an Android app (APK) that will run on
* Android 3.0 or later, set DEVELOPER_MODE to "true", otherwise, will not work. (App for Boy Kuripot [Ver. 1])
*
*/
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectAll().penaltyLog().build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
}
这里是发生什么事,如果我设定的最低SDK版本7,你会看到一个错误的红线apeared:
下面是发生什么事,如果我设定的最低SDK通过Android清单版本以11:
此外,当我运行它使用AsyncTask,它变得更慢,更快,或者仅仅滞后。
//TODO _________________________[ Activity Starter Subclass ]_________________________
private class Post_Task extends AsyncTask<String, Integer, String> // --> This class will be revised and to be used for next version. (Compatible now with Android 2.1 and later.)
{
@Override
protected void onPreExecute()
{
super.onPreExecute();
}
@Override
protected String doInBackground(String... params)
{
//-----[ RSS Feed Setup ]-----
xp.Get_Parse_Feed(URL_link, is, lm.headlines, lm.links);
return "All done!";
}
@Override
protected void onProgressUpdate(Integer... values)
{
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(String result)
{
super.onPostExecute(result);
}
}
当我恢复,并在的onCreate()作为主线程运行此xp.Get_Parse_Feed(URL_link, is, lm.headlines, lm.links);
代码,有时我们在短短的瞬间正确加载的链接。问题是我应该管理哪一个以及如何使这个博客应用程序与Android 2.1兼容?