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