当前位置: 首页>>代码示例>>Java>>正文


Java Context.toString方法代码示例

本文整理汇总了Java中android.content.Context.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Context.toString方法的具体用法?Java Context.toString怎么用?Java Context.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.Context的用法示例。


在下文中一共展示了Context.toString方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);

    // This makes sure that the container activity has implemented
    // the callback interface. If not, it throws an exception
    if (context instanceof OnLabelSelectedListener){
        try {
            mCallback = (OnLabelSelectedListener) context;
        } catch (ClassCastException e) {
            throw new ClassCastException(context.toString()
                    + " must implement OnHeadlineSelectedListener");
        }
    }

}
 
开发者ID:danlls,项目名称:Todule-android,代码行数:17,代码来源:ToduleLabelFragment.java

示例2: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnPhotoInteractionListener) {
        mListener = (OnPhotoInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnPhotoInteractionListener");
    }
}
 
开发者ID:gvsucis,项目名称:mobile-app-dev-book,代码行数:11,代码来源:PhotoFragment.java

示例3: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnFragmentInteractionListener) {
        mListener = (OnFragmentInteractionListener) context;
        context = context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
开发者ID:tonyzhang617,项目名称:tutoriah,代码行数:12,代码来源:IndTutoringFragment.java

示例4: onAttach

import android.content.Context; //导入方法依赖的package包/类
@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");
    }
}
 
开发者ID:Francescopaolo44,项目名称:AndroidApp-Deploy,代码行数:11,代码来源:Fragment_three.java

示例5: TouchableWrapper

import android.content.Context; //导入方法依赖的package包/类
public TouchableWrapper(Context context) {
    super(context);

    try {
     //   updateMapUserClick = (MainActivity) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement UpdateMapUserClick");
    }
}
 
开发者ID:cahergil,项目名称:Farmacias,代码行数:10,代码来源:TouchableWrapper.java

示例6: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof Listener) {
        this.activityCallback = (Listener) context;
    } else {
        throw new ClassCastException(context.toString()
                + " must implement Listener");
    }
}
 
开发者ID:m2049r,项目名称:xmrwallet,代码行数:11,代码来源:LoginFragment.java

示例7: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        callback = (TimeoutListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString() + " must implement TimeoutListener");
    }
}
 
开发者ID:steevp,项目名称:UpdogFarmer,代码行数:10,代码来源:TimeoutFragment.java

示例8: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    // Verify that the host activity implements the callback interface
    try {
        // Instantiate the NoticeDialogListener so we can send events to the host
        mListener = (NoteEditDialogListener) context;
    } catch (ClassCastException e) {
        // The activity doesn't implement the interface, throw exception
        throw new ClassCastException(context.toString()
                + " must implement NoteEditDialogListener");
    }
}
 
开发者ID:ramack,项目名称:ActivityDiary,代码行数:14,代码来源:NoteEditDialog.java

示例9: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof OnAuthorItemClickListener) {

        mListener = (OnAuthorItemClickListener) context;

    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnCategoryItemClickListener");
    }
    if (context instanceof BrowsingActivity) {
        ((BrowsingActivity) context).registerListener(this);
    }
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:16,代码来源:AuthorListFragment.java

示例10: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    try {
        mListener = (SortItemsDialogListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement SortItemsDialogListener");
    }
}
 
开发者ID:mvescovo,项目名称:item-reaper,代码行数:11,代码来源:SortItemsDialogFragment.java

示例11: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof MessagesFragmentInteractionListener) {
        listener = (MessagesFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement MessagesFragmentInteractionListener");
    }
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:11,代码来源:MessagesFragment.java

示例12: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof RepositoriesListFragment.OnFragmentInteractionListener) {
        mListener = (RepositoriesListFragment.OnFragmentInteractionListener) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:11,代码来源:RepositoriesListFragment.java

示例13: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    if (context instanceof SearchFragmentCallback) {
        searchFragmentCallback = (SearchFragmentCallback) context;
    } else {
        throw new RuntimeException(context.toString()
                + " must implement SearchFragmentCallback");
    }
}
 
开发者ID:rascarlo,项目名称:AURdroid,代码行数:11,代码来源:SearchFragment.java

示例14: onAttach

import android.content.Context; //导入方法依赖的package包/类
@Override
public void onAttach(Context context) {
    super.onAttach(context);
    mContext = context;
    try {
        mListener = (OnFragmentInteractionListener) context;
    } catch (ClassCastException e) {
        throw new ClassCastException(context.toString()
                + " must implement OnFragmentInteractionListener");
    }
}
 
开发者ID:uncleashi,项目名称:find-client-android,代码行数:12,代码来源:TrackFragment.java


注:本文中的android.content.Context.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。