本文整理匯總了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");
}
}