Search in sources :

Example 16 with Shelf

use of com.orgzly.android.Shelf in project orgzly-android by orgzly.

the class SyncFragment method onAttach.

/**
 * Hold a reference to the parent Activity so we can report the
 * task's current progress and results. The Android framework
 * will pass us a reference to the newly created Activity after
 * each configuration change.
 */
@Override
public void onAttach(Context context) {
    if (BuildConfig.LOG_DEBUG)
        LogUtils.d(TAG, getActivity());
    super.onAttach(context);
    /* This makes sure that the container activity has implemented
         * the callback interface. If not, it throws an exception
         */
    try {
        mListener = (SyncFragmentListener) getActivity();
    } catch (ClassCastException e) {
        throw new ClassCastException(getActivity().toString() + " must implement " + SyncFragmentListener.class);
    }
    mShelf = new Shelf(context.getApplicationContext());
    resources = context.getResources();
}
Also used : Shelf(com.orgzly.android.Shelf)

Aggregations

Shelf (com.orgzly.android.Shelf)16 Book (com.orgzly.android.Book)4 Intent (android.content.Intent)3 AppIntent (com.orgzly.android.AppIntent)3 Note (com.orgzly.android.Note)3 IOException (java.io.IOException)3 Uri (android.net.Uri)2 Fragment (android.support.v4.app.Fragment)2 Toolbar (android.support.v7.widget.Toolbar)2 Query (com.orgzly.android.query.Query)2 File (java.io.File)2 SuppressLint (android.annotation.SuppressLint)1 Activity (android.app.Activity)1 AlertDialog (android.app.AlertDialog)1 BroadcastReceiver (android.content.BroadcastReceiver)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 IntentFilter (android.content.IntentFilter)1 Configuration (android.content.res.Configuration)1 TypedArray (android.content.res.TypedArray)1