編輯:關於Android編程
You create a CursorLoader within a loader framework. To set up the framework, you implement theLoaderCallbacks<Cursor> as part of an Activity. In addition, to provide compatibility compatible with platform versions starting with Android 1.6, you must extend theActivity with the FragmentActivity class. http://blog.csdn.net/sergeycao
Note: A Fragment is not a prerequisite forCursorLoader. As a convenience, the support library classFragmentActivity contains the fragment and the loader frameworks, but they are completely independent of each other.
Before you can use the loader framework, you need to initialize it. To do this, retrieve aLoaderManager object and call its initLoader() method.
If you do use one or more Fragment objects in an Activity, the LoaderManager you retrieve is available to all of them.
Extend an Activity
To set up an Activity subclass to contain a CursorLoader, extend the subclass with must extend FragmentActivity, which provides the loader framework, and implement theLoaderCallbacks<Cursor> interface, which specifies method signatures that the loader framework uses to interact with theActivity.
For example:
public class DisplayActivity extends FragmentActivity
implements LoaderManager.LoaderCallbacks<Cursor>
Retrieve a LoaderManager
To get an instance LoaderManager for use in your Activity, call FragmentActivity.getSupportLoaderManager() at the beginning of theonCreate() method. For example:
private LoaderManager mLoaderManager;
public void onCreate() {
...
mLoaderManager = this.getSupportLoaderManager();
Initialize the Loader Framework
Once you have the LoaderManager object, initialize it by callinginitLoader(). For example:
// CursorLoader instance identifier
public static final int URL_LOADER = 0;
...
// Initializes the CursorLoader
getSupportLoaderManager().initLoader(URL_LOADER, null, this);
前言Android Studio對於快捷鍵的設置比較的靈活,開發者在從不同的平台轉移到Android Studio進行Android開發的時候,應該都能找到合適的KeyM
11. Android的數據存儲形式在Android中的數據存儲形式主要有以下幾種:SharedPreferrencesSharedPreferrences主要用於存儲一
使用SlidingTabLayout需要准備2個類,分別是 SlidingTabLayout,與SlidingTabStrip,,放進項目中時只用修改下包名即可。 效果制
前面文章講述了Android手機與BLE終端之間的通信,而最常見的BLE終端應該是蘋果公司倡導的iBeacon基站。iBeacon技術基於BLE,它的特點是通過廣播對外發