本文整理汇总了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");
}
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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);
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}