android.content.Context#toString ( )源码实例Demo

下面列出了android.content.Context#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: odyssey   文件: OdysseyBaseFragment.java
@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);

    if (null == mComponentCallback) {
        mComponentCallback = new OdysseyComponentCallback();
    }

    // Register the memory trim callback with the system.
    context.registerComponentCallbacks(mComponentCallback);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    try {
        mToolbarAndFABCallback = (ToolbarAndFABCallback) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement ToolbarAndFABCallback");
    }
}
 
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
    if(day == null){
        day = Calendar.getInstance();
    }
    if(!day.getTimeZone().equals(TimeZone.getDefault())) {
        day = Calendar.getInstance();
        generateReports(true);
    }
    // Bind to stepDetector if today is shown
    if (isTodayShown() && StepDetectionServiceHelper.isStepDetectionEnabled(getContext())) {
        bindService();
    }
    registerReceivers();
}
 
源代码3 项目: GitJourney   文件: FeedListFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
源代码4 项目: Pas   文件: BlankFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
源代码5 项目: xmrwallet   文件: ReceiveFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof Listener) {
        this.listenerCallback = (Listener) context;
    } else {
        throw new ClassCastException(context.toString()
                + " must implement Listener");
    }
    if (context instanceof GenerateReviewFragment.ProgressListener) {
        this.progressCallback = (GenerateReviewFragment.ProgressListener) context;
    }
}
 
public TouchableWrapper(Context context) {
    super(context);
    // Force the host activity to implement the UpdateMapAfterUserInterection Interface
    try {
        updateMapAfterUserInterection = (SearchPlaceOnMapActivity) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement UpdateMapAfterUserInterection");
    }
}
 
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        interfaceWithConfigurationWizard = (DownloadFailedDialogInterface) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement NoticeDialogListener");
    }
}
 
@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);
    try {
        mListener = (BookDeleteDialogListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement BookDeleteDialogListener");
    }
}
 
源代码9 项目: PercentageChartView   文件: BehaviorSubFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnBehaviorChangedListener) {
        mListener = (OnBehaviorChangedListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnBehaviorChangedListener");
    }
}
 
源代码10 项目: AndroidDigIn   文件: RecyclerDataFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnRecyclerFragmentInteractionListener) {
        mListener = (OnRecyclerFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnRecyclerFragmentInteractionListener");
    }
}
 
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnTableOfContentTitleClickListener) {
        mListener = (OnTableOfContentTitleClickListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnTableOfContentTitleClickListener");
    }
}
 
源代码12 项目: OpenLibre   文件: LogFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        mCallback = (OnScanDataListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement OnScanDataListener");
    }
}
 
源代码13 项目: MapForTour   文件: OptionMapFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    try {
        mListener = (OptionFragmentOnclickListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + "must implement OptionFragmentOnclickListener");
    }

}
 
源代码14 项目: Pas   文件: FragmentNews.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof MainActivity) {
        mListener = (MainActivityInterface) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement MainAFInterface");
    }
}
 
源代码15 项目: argus-android   文件: BaseFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof ResultListener) {
        resultListener = (ResultListener) context;
    } else {
        throw new RuntimeException(context.toString() + " must implement ResultListener");
    }
}
 
@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);
    if (context instanceof Listener) {
        mListener = (Listener) context;
    } /*else if (getTargetFragment() instanceof Listener) {
        mListener = (Listener) getTargetFragment();
    } else if (getTargetFragment() != null && getTargetFragment().getActivity() instanceof Listener) {
        mListener = (Listener) getTargetFragment().getActivity();
    } */ else {
        throw new RuntimeException(context.toString() + " must implement Listener");
    }
}
 
源代码17 项目: mvvm-starter   文件: ForgotPasswordFragment.java
@Override
public void onAttach (Context context)
{
    super.onAttach(context);
    if (context instanceof OnForgotFragmentInteractionListener)
    {
        mListener = (OnForgotFragmentInteractionListener) context;
    }
    else
    {
        throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener");
    }
}
 
源代码18 项目: io16experiment-master   文件: ConnectFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (!(context instanceof Callbacks)) {
        throw new ClassCastException(context.toString() + " must implement " + ConnectFragment.class.getSimpleName());
    }

    mCallbacks = (Callbacks) context;
}
 
源代码19 项目: AndroidPlayground   文件: FragmentLayer2.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(
                context.toString() + " must implement OnFragmentInteractionListener");
    }
}
 
源代码20 项目: beaconloc   文件: BeaconFragment.java
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    try {
        mBeaconSelectedListener = (OnTrackedBeaconSelectedListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement OnTrackedBeaconSelectedListener");
    }
}
 
 方法所在类
 同类方法