本文整理汇总了Java中android.app.Activity.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.toString方法的具体用法?Java Activity.toString怎么用?Java Activity.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Activity
的用法示例。
在下文中一共展示了Activity.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void onAttach(Activity activity) {
super.onAttach(activity);
if (activity instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) activity;
} else {
throw new RuntimeException(activity.toString()
+ " must implement OnFragmentInteractionListener");
}
}
示例2: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
serverAdapterListCallbacks = (ServerAdapterListCallbacks) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement ServerAdapterListCallbacks");
}
}
示例3: onAttach
import android.app.Activity; //导入方法依赖的package包/类
/** onAttach 在 fragment 第一次被联系到它的 activity 上时被调用 */
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// 确保父 activity 实现回调接口,如果没实现,抛出异常
try {
mCallback = (OnHeadlineSelectedListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnHeadlineSelectedListener");
}
}
示例4: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// Verify that the host activity implements the callback interface
try {
// Instantiate the NoticeDialogListener so we can send events to the host
mListener = (NoticeDialogListener) activity;
} catch (ClassCastException e) {
// The activity doesn't implement the interface, throw exception
throw new ClassCastException(activity.toString()
+ " must implement NoticeDialogListener");
}
}
示例5: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
conversationFragmentCallbackListener = (ConversationFragmentCallbackListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement ConversationFragmentCallbackListener");
}
}
示例6: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
incomeCallFragmentCallbackListener = (IncomeCallFragmentCallbackListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnCallEventsController");
}
}
示例7: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// Verify that the host activity implements the callback interface
try {
// Instantiate the SendChallengeDialogListener so we can sendMessage events to the host
listener = (SendScheduleDialogListener) activity;
} catch (ClassCastException e) {
// The activity doesn't implement the interface, throw exception
throw new ClassCastException(activity.toString()
+ " must implement SendScheduleDialogListener");
}
}
示例8: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mRetryTokenListener = (RetryTokenListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement RetryTokenListener");
}
}
示例9: onAttach
import android.app.Activity; //导入方法依赖的package包/类
/**
* This will make sure that {@link OnDeviceSelectedListener} interface is implemented by activity.
*/
@Override
public void onAttach(final Activity activity) {
super.onAttach(activity);
try {
this.mListener = (OnDeviceSelectedListener) activity;
} catch (final ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement OnDeviceSelectedListener");
}
}
示例10: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mListener = (OnCompleteListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement OnCompleteListener");
}
}
示例11: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onAttach(Activity context) {
super.onAttach(context);
if (context instanceof OnPlayPauseClickedListener) {
mCallback = (OnPlayPauseClickedListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnPlayPauseClickedListener");
}
}
示例12: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity context) {
super.onAttach(context);
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
mNavigationCallback = (MainActivity) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString()
+ " must implement OnHeadlineSelectedListener");
}
}
示例13: onAttach
import android.app.Activity; //导入方法依赖的package包/类
/**
* Called when a fragment is first attached to its activity. onCreate(Bundle) will be called after this.
*
* @param activity
*/
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mListener = (OnSettingsListener) activity;
appData = new AppData(activity.getApplicationContext());
isFullScreen = appData.getClockFullScreen();
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnSettingsListener");
}
}
示例14: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
attachedActivity = activity;
try {
listener = (OnFragmentInteractionListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnFragmentInteractionListener");
}
}
示例15: onAttach
import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try {
mCallback = (EditBuildInfoListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement EditBuildInfoListener");
}
}